Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +10 -0
- requirements.txt +2 -0
app.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
pipe = pipeline("text2text-generation", model="yxccai/text-style")
|
5 |
+
|
6 |
+
def chat(input_text):
|
7 |
+
result = pipe(input_text, max_new_tokens=512)[0]["generated_text"]
|
8 |
+
return result
|
9 |
+
|
10 |
+
gr.Interface(fn=chat, inputs="text", outputs="text").launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
transformers
|
2 |
+
gradio
|