Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
# import gradio as gr
|
2 |
-
# from transformers import pipeline
|
3 |
-
# model = pipeline("text-generation", model="DmitryYarov/plato_2024_1.0")
|
4 |
-
# def predict(prompt):
|
5 |
-
# completion = model(prompt)[0]["generated_text"]
|
6 |
-
# return completion
|
7 |
-
|
8 |
-
# gr.Interface(fn=predict, inputs="text", outputs="text").launch()
|
9 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
def greet(name, intensity):
|
12 |
-
|
13 |
|
14 |
-
demo = gr.Interface(
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
)
|
19 |
|
20 |
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
model = pipeline("text-generation", model="DmitryYarov/plato_2024_1.0")
|
4 |
+
def predict(prompt):
|
5 |
+
completion = model(prompt)[0]["generated_text"]
|
6 |
+
return completion
|
7 |
+
|
8 |
+
gr.Interface(fn=predict, inputs="text", outputs="text").launch()
|
9 |
+
# import gradio as gr
|
10 |
|
11 |
+
# def greet(name, intensity):
|
12 |
+
# return "Hello, " + name + "!" * int(intensity)
|
13 |
|
14 |
+
# demo = gr.Interface(
|
15 |
+
# fn=greet,
|
16 |
+
# inputs=["text", "slider"],
|
17 |
+
# outputs=["text"],
|
18 |
+
# )
|
19 |
|
20 |
demo.launch()
|