Spaces:
Sleeping
Sleeping
Elijahbodden
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,16 @@ from transformers import AutoTokenizer
|
|
8 |
from huggingface_hub import upload_file
|
9 |
import json
|
10 |
from uuid import uuid4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
model_id = "Elijahbodden/eliGPTv1.3"
|
13 |
|
@@ -69,7 +79,8 @@ def respond(
|
|
69 |
response = ""
|
70 |
|
71 |
print(tokenizer.apply_chat_template(messages, tokenize=False))
|
72 |
-
|
|
|
73 |
convo = tokenizer.apply_chat_template(messages, tokenize=True)
|
74 |
for message in model.create_completion(
|
75 |
convo,
|
@@ -89,6 +100,7 @@ def respond(
|
|
89 |
response += token
|
90 |
yield response
|
91 |
print(response)
|
|
|
92 |
|
93 |
ci = gr.ChatInterface(
|
94 |
respond,
|
|
|
8 |
from huggingface_hub import upload_file
|
9 |
import json
|
10 |
from uuid import uuid4
|
11 |
+
import logging
|
12 |
+
logging.basicConfig(filename="logs.log",
|
13 |
+
filemode='a',
|
14 |
+
format='%(asctime)s %(message)s',
|
15 |
+
filemode='w')
|
16 |
+
|
17 |
+
logger = logging.getLogger()
|
18 |
+
|
19 |
+
logger.setLevel(logging.DEBUG)
|
20 |
+
|
21 |
|
22 |
model_id = "Elijahbodden/eliGPTv1.3"
|
23 |
|
|
|
79 |
response = ""
|
80 |
|
81 |
print(tokenizer.apply_chat_template(messages, tokenize=False))
|
82 |
+
logger.info(tokenizer.apply_chat_template(messages, tokenize=False))
|
83 |
+
|
84 |
convo = tokenizer.apply_chat_template(messages, tokenize=True)
|
85 |
for message in model.create_completion(
|
86 |
convo,
|
|
|
100 |
response += token
|
101 |
yield response
|
102 |
print(response)
|
103 |
+
logger.info("RESP: " + response)
|
104 |
|
105 |
ci = gr.ChatInterface(
|
106 |
respond,
|