add support for novita.ai (#1910)

### What problem does this PR solve?

#1853  add support for novita.ai

### Type of change


- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: Zhedong Cen <cenzhedong2@126.com>
This commit is contained in:
黄腾
2024-08-12 17:26:26 +08:00
committed by GitHub
parent 6baba54e9e
commit 68d1315079
6 changed files with 170 additions and 4 deletions

View File

@ -532,8 +532,7 @@ class LLM(DataBaseModel):
max_length=128,
null=False,
help_text="LLM name",
index=True,
primary_key=True)
index=True)
model_type = CharField(
max_length=128,
null=False,
@ -558,6 +557,7 @@ class LLM(DataBaseModel):
return self.llm_name
class Meta:
primary_key = CompositeKey('fid', 'llm_name')
db_table = "llm"
@ -965,3 +965,8 @@ def migrate_db():
)
except Exception as e:
pass
try:
DB.execute_sql('ALTER TABLE llm DROP PRIMARY KEY;')
DB.execute_sql('ALTER TABLE llm ADD PRIMARY KEY (llm_name,fid);')
except Exception as e:
pass