Spaces:
Runtime error
Runtime error
ffreemt
commited on
Commit
•
7eb763b
1
Parent(s):
634ed9b
app.py
CHANGED
@@ -42,7 +42,7 @@ if has_cuda:
|
|
42 |
)
|
43 |
else:
|
44 |
model = (
|
45 |
-
AutoModel.from_pretrained(model_name, trust_remote_code=True).
|
46 |
) # .float() .half().float(): must use float for cpu
|
47 |
|
48 |
model = model.eval()
|
@@ -94,9 +94,10 @@ with gr.Blocks(theme=theme) as block:
|
|
94 |
clear = gr.ClearButton([msg, chatbot])
|
95 |
|
96 |
# do not clear prompt
|
97 |
-
|
|
|
|
|
98 |
|
99 |
-
btn.click(respond, [msg, chatbot], [msg, chatbot])
|
100 |
|
101 |
with gr.Accordion("Example inputs", open=True):
|
102 |
etext = """In America, where cars are an important part of the national psyche, a decade ago people had suddenly started to drive less, which had not happened since the oil shocks of the 1970s. """
|
|
|
42 |
)
|
43 |
else:
|
44 |
model = (
|
45 |
+
AutoModel.from_pretrained(model_name, trust_remote_code=True).float()
|
46 |
) # .float() .half().float(): must use float for cpu
|
47 |
|
48 |
model = model.eval()
|
|
|
94 |
clear = gr.ClearButton([msg, chatbot])
|
95 |
|
96 |
# do not clear prompt
|
97 |
+
btn.submit(respond, [msg, chatbot], [msg, chatbot])
|
98 |
+
|
99 |
+
msg.click(lambda x, y: ("",) + respond(x, y)[1:], [msg, chatbot], [msg, chatbot])
|
100 |
|
|
|
101 |
|
102 |
with gr.Accordion("Example inputs", open=True):
|
103 |
etext = """In America, where cars are an important part of the national psyche, a decade ago people had suddenly started to drive less, which had not happened since the oil shocks of the 1970s. """
|