Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
3 |
import os
|
4 |
import time
|
5 |
|
@@ -110,7 +110,7 @@ def predict_chat(message: str, history: list):
|
|
110 |
temperature=TEMPERATURE,
|
111 |
top_k=TOP_K,
|
112 |
top_p=TOP_P,
|
113 |
-
do_sample=DO_SAMPLE, # Corrected parameter passing
|
114 |
repetition_penalty=1.1,
|
115 |
stop=["User:", "\nUser", "\n#", "\n##", "<|endoftext|>"],
|
116 |
stream=True
|
@@ -127,7 +127,7 @@ def predict_chat(message: str, history: list):
|
|
127 |
temperature=TEMPERATURE,
|
128 |
top_k=TOP_K,
|
129 |
top_p=TOP_P,
|
130 |
-
do_sample=DO_SAMPLE, # Corrected parameter passing
|
131 |
repetition_penalty=1.1,
|
132 |
stop=["User:", "\nUser", "\n#", "\n##", "<|endoftext|>"]
|
133 |
)
|
@@ -153,7 +153,7 @@ def predict_chat(message: str, history: list):
|
|
153 |
temperature=TEMPERATURE,
|
154 |
top_k=TOP_K,
|
155 |
top_p=TOP_P,
|
156 |
-
do_sample=DO_SAMPLE, # Uncommented for use
|
157 |
pad_token_id=tokenizer.pad_token_id
|
158 |
)
|
159 |
generated_text = tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True).strip()
|
|
|
1 |
import gradio as gr
|
2 |
+
import torchdo_s
|
3 |
import os
|
4 |
import time
|
5 |
|
|
|
110 |
temperature=TEMPERATURE,
|
111 |
top_k=TOP_K,
|
112 |
top_p=TOP_P,
|
113 |
+
#do_sample=DO_SAMPLE, # Corrected parameter passing
|
114 |
repetition_penalty=1.1,
|
115 |
stop=["User:", "\nUser", "\n#", "\n##", "<|endoftext|>"],
|
116 |
stream=True
|
|
|
127 |
temperature=TEMPERATURE,
|
128 |
top_k=TOP_K,
|
129 |
top_p=TOP_P,
|
130 |
+
#do_sample=DO_SAMPLE, # Corrected parameter passing
|
131 |
repetition_penalty=1.1,
|
132 |
stop=["User:", "\nUser", "\n#", "\n##", "<|endoftext|>"]
|
133 |
)
|
|
|
153 |
temperature=TEMPERATURE,
|
154 |
top_k=TOP_K,
|
155 |
top_p=TOP_P,
|
156 |
+
#do_sample=DO_SAMPLE, # Uncommented for use
|
157 |
pad_token_id=tokenizer.pad_token_id
|
158 |
)
|
159 |
generated_text = tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True).strip()
|