Spaces:
Sleeping
Sleeping
vtrv.vls
commited on
Commit
·
b49edc5
1
Parent(s):
4fa4c7b
Functionality rework
Browse files
models.py
CHANGED
|
@@ -23,6 +23,7 @@ class GigaChat:
|
|
| 23 |
|
| 24 |
@classmethod
|
| 25 |
def get_giga(cls, auth_file='auth_token.json'):
|
|
|
|
| 26 |
return cls(auth_file)
|
| 27 |
|
| 28 |
def gen_giga_token(self, auth_file):
|
|
@@ -73,6 +74,7 @@ class GigaChat:
|
|
| 73 |
|
| 74 |
|
| 75 |
def get_tinyllama():
|
|
|
|
| 76 |
tinyllama = pipeline("text-generation", model="TinyLlama/TinyLlama-1.1B-Chat-v1.0", torch_dtype=torch.float16, device_map="auto")
|
| 77 |
return tinyllama
|
| 78 |
|
|
|
|
| 23 |
|
| 24 |
@classmethod
|
| 25 |
def get_giga(cls, auth_file='auth_token.json'):
|
| 26 |
+
print('got giga')
|
| 27 |
return cls(auth_file)
|
| 28 |
|
| 29 |
def gen_giga_token(self, auth_file):
|
|
|
|
| 74 |
|
| 75 |
|
| 76 |
def get_tinyllama():
|
| 77 |
+
print('got llama')
|
| 78 |
tinyllama = pipeline("text-generation", model="TinyLlama/TinyLlama-1.1B-Chat-v1.0", torch_dtype=torch.float16, device_map="auto")
|
| 79 |
return tinyllama
|
| 80 |
|
utils.py
CHANGED
|
@@ -17,6 +17,7 @@ def model_response(
|
|
| 17 |
model_name,
|
| 18 |
model_params
|
| 19 |
):
|
|
|
|
| 20 |
chat_history.append([content])
|
| 21 |
res = gen_lib[model_name](initialized_models[model_name], chat_history, model_params)
|
| 22 |
chat_history[-1].append(res)
|
|
|
|
| 17 |
model_name,
|
| 18 |
model_params
|
| 19 |
):
|
| 20 |
+
print(f'{model_name} response')
|
| 21 |
chat_history.append([content])
|
| 22 |
res = gen_lib[model_name](initialized_models[model_name], chat_history, model_params)
|
| 23 |
chat_history[-1].append(res)
|