Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,20 +1,11 @@
|
|
| 1 |
# How to poop like a cat?
|
| 2 |
|
| 3 |
import gradio as gr
|
|
|
|
| 4 |
from transformers import pipeline
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
gradio_app = gr.Interface(
|
| 13 |
-
predict,
|
| 14 |
-
inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
|
| 15 |
-
outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
|
| 16 |
-
title="Hot Dog? Or Not?",
|
| 17 |
-
)
|
| 18 |
-
|
| 19 |
-
if __name__ == "__main__":
|
| 20 |
-
gradio_app.launch()
|
|
|
|
| 1 |
# How to poop like a cat?
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
+
# Use a pipeline as a high-level helper
|
| 5 |
from transformers import pipeline
|
| 6 |
|
| 7 |
+
pipe = pipeline("text-generation", model="mistralai/Mistral-Nemo-Instruct-2407")
|
| 8 |
+
messages = [
|
| 9 |
+
{"role": "user", "content": "Who are you?"},
|
| 10 |
+
]
|
| 11 |
+
pipe(messages)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|