Update app.py
Browse files
app.py
CHANGED
|
@@ -1,18 +1,4 @@
|
|
| 1 |
-
#
|
| 2 |
-
|
| 3 |
|
| 4 |
-
|
| 5 |
-
from diffusers import DiffusionPipeline
|
| 6 |
-
|
| 7 |
-
pipe = DiffusionPipeline.from_pretrained(MODEL_ID)
|
| 8 |
-
pipe.to('cuda')
|
| 9 |
-
|
| 10 |
-
@spaces.GPU
|
| 11 |
-
def generate(prompt):
|
| 12 |
-
return pipe(prompt).images
|
| 13 |
-
|
| 14 |
-
gr.Interface(
|
| 15 |
-
fn=generate,
|
| 16 |
-
inputs=gr.Text(),
|
| 17 |
-
outputs=gr.Gallery(),
|
| 18 |
-
).launch()
|
|
|
|
| 1 |
+
# Use a pipeline as a high-level helper
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
+
pipe = pipeline("text-generation", model="microsoft/bitnet-b1.58-2B-4T-gguf")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|