Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -157,18 +157,20 @@ def query(system_prompt, user_prompt, temperature=0.9, max_new_tokens=256, top_p
|
|
157 |
seed=seed,
|
158 |
)
|
159 |
prompt = f"System: {system_prompt}\nUser: {user_prompt}\n"
|
160 |
-
|
161 |
-
output =
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
|
|
|
|
172 |
return output
|
173 |
|
174 |
iface = gr.Interface(
|
|
|
157 |
seed=seed,
|
158 |
)
|
159 |
prompt = f"System: {system_prompt}\nUser: {user_prompt}\n"
|
160 |
+
print(prompt)
|
161 |
+
output = client.text_generation(prompt, **generate_kwargs, details=True, return_full_text=False)
|
162 |
+
# stream = client.text_generation(prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
163 |
+
# output = ""
|
164 |
+
|
165 |
+
# for response in stream:
|
166 |
+
# output += response.token.text
|
167 |
+
|
168 |
+
# for stop_str in STOP_SEQUENCES:
|
169 |
+
# if output.endswith(stop_str):
|
170 |
+
# output = output[:-len(stop_str)]
|
171 |
+
# output = output.rstrip()
|
172 |
+
# yield output
|
173 |
+
# yield output
|
174 |
return output
|
175 |
|
176 |
iface = gr.Interface(
|