Spaces:
Running
on
Zero
Running
on
Zero
Staticaliza
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -44,4 +44,21 @@ class ModelWrapper:
|
|
44 |
generated_text = ""
|
45 |
for new_text in streamer:
|
46 |
generated_text += new_text
|
47 |
-
yield generated_text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
generated_text = ""
|
45 |
for new_text in streamer:
|
46 |
generated_text += new_text
|
47 |
+
yield generated_text
|
48 |
+
|
49 |
+
model_wrapper = ModelWrapper()
|
50 |
+
|
51 |
+
interface = gr.Interface(
|
52 |
+
fn=model_wrapper.generate,
|
53 |
+
inputs=gr.Textbox(lines=5, label="Input Prompt"),
|
54 |
+
outputs=gr.Textbox(label="Generated Text"),
|
55 |
+
title="Mistral-Large-Instruct-2407 Text Completion",
|
56 |
+
description="Enter a prompt and receive a text completion using the Mistral-Large-Instruct-2407 INT4 model.",
|
57 |
+
allow_flagging='never',
|
58 |
+
live=False,
|
59 |
+
cache_examples=False,
|
60 |
+
streaming=True
|
61 |
+
)
|
62 |
+
|
63 |
+
if __name__ == "__main__":
|
64 |
+
interface.launch()
|