app.py
CHANGED
@@ -127,6 +127,20 @@ def respond(message, history):
|
|
127 |
out = model.generate(**inputs, max_new_tokens=512, temperature=0.7, top_p=0.9)
|
128 |
return tokenizer.decode(out[0], skip_special_tokens=True)
|
129 |
|
130 |
-
iface = gr.ChatInterface(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
if __name__ == "__main__":
|
132 |
-
iface.launch(
|
|
|
|
|
|
|
|
|
|
127 |
out = model.generate(**inputs, max_new_tokens=512, temperature=0.7, top_p=0.9)
|
128 |
return tokenizer.decode(out[0], skip_special_tokens=True)
|
129 |
|
130 |
+
iface = gr.ChatInterface(
|
131 |
+
fn=respond,
|
132 |
+
title="Gemma-ZeroGPU Demo",
|
133 |
+
chatbot=gr.Chatbot(
|
134 |
+
type="messages",
|
135 |
+
height=600,
|
136 |
+
show_copy_button=True,
|
137 |
+
show_share_button=True
|
138 |
+
)
|
139 |
+
)
|
140 |
+
|
141 |
if __name__ == "__main__":
|
142 |
+
iface.launch(
|
143 |
+
server_name="0.0.0.0",
|
144 |
+
server_port=7860,
|
145 |
+
share=True
|
146 |
+
)
|