Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import spaces
|
| 3 |
+
|
| 4 |
+
from transformers import pipeline
|
| 5 |
+
|
| 6 |
+
upsampler = pipeline("text-generation", model="appmana/Cosmos-1.0-Prompt-Upsampler-12B-Text2World-hf")
|
| 7 |
+
|
| 8 |
+
@spaces.GPU
|
| 9 |
+
def upsample(prompt):
|
| 10 |
+
response = upsampler(f"Upsample the short caption to a long caption: {prompt}")
|
| 11 |
+
return response
|
| 12 |
+
|
| 13 |
+
demo = gr.Interface(fn=upsample, inputs=gr.Text(), outputs=gr.Text())
|
| 14 |
+
demo.launch()
|