Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,6 @@ def get_detailed_instruct(task_description: str, query: str) -> str:
|
|
16 |
return f'Instruct: {task_description}\nQuery: {query}'
|
17 |
|
18 |
def respond(message,
|
19 |
-
history: list[tuple[str, str]],
|
20 |
max_tokens = 2048,
|
21 |
temperature = 0.7,
|
22 |
top_p = 0.95,
|
@@ -36,13 +35,6 @@ def respond(message,
|
|
36 |
|
37 |
print("added more references\n")
|
38 |
print(time.time())
|
39 |
-
|
40 |
-
#history from chat session
|
41 |
-
for val in history:
|
42 |
-
if val[0]:
|
43 |
-
messages.append({"role": "user", "content": val[0]})
|
44 |
-
if val[1]:
|
45 |
-
messages.append({"role": "assistant", "content": val[1]})
|
46 |
|
47 |
#latest user question
|
48 |
from googletrans import Translator
|
@@ -117,7 +109,7 @@ def respond(message,
|
|
117 |
print("An error occurred:", error)
|
118 |
yield response
|
119 |
"""
|
120 |
-
demo = gr.
|
121 |
fn=respond,
|
122 |
additional_inputs=[
|
123 |
gr.Slider(minimum=1, maximum=2048, value=2048, step=1, label="Max new tokens"),
|
@@ -130,6 +122,8 @@ demo = gr.ChatInterface(
|
|
130 |
label="Top-p (nucleus sampling)",
|
131 |
),
|
132 |
],
|
|
|
|
|
133 |
cache_examples="lazy",
|
134 |
examples=[
|
135 |
["Why is men created?"],
|
|
|
16 |
return f'Instruct: {task_description}\nQuery: {query}'
|
17 |
|
18 |
def respond(message,
|
|
|
19 |
max_tokens = 2048,
|
20 |
temperature = 0.7,
|
21 |
top_p = 0.95,
|
|
|
35 |
|
36 |
print("added more references\n")
|
37 |
print(time.time())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
#latest user question
|
40 |
from googletrans import Translator
|
|
|
109 |
print("An error occurred:", error)
|
110 |
yield response
|
111 |
"""
|
112 |
+
demo = gr.Interface(
|
113 |
fn=respond,
|
114 |
additional_inputs=[
|
115 |
gr.Slider(minimum=1, maximum=2048, value=2048, step=1, label="Max new tokens"),
|
|
|
122 |
label="Top-p (nucleus sampling)",
|
123 |
),
|
124 |
],
|
125 |
+
inputs="textbox",
|
126 |
+
outputs="textbox",
|
127 |
cache_examples="lazy",
|
128 |
examples=[
|
129 |
["Why is men created?"],
|