benjamin-paine commited on
Commit
665309d
·
verified ·
1 Parent(s): bd47815

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
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()