Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,14 @@
|
|
| 1 |
|
| 2 |
import torch
|
| 3 |
from transformers import pipeline
|
|
|
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
| 6 |
device = torch.device("cpu")
|
| 7 |
pipe = pipeline(
|
|
|
|
| 1 |
|
| 2 |
import torch
|
| 3 |
from transformers import pipeline
|
| 4 |
+
import gradio as gr
|
| 5 |
|
| 6 |
+
def greet(name):
|
| 7 |
+
return "Hello " + name + "!"
|
| 8 |
+
|
| 9 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 10 |
+
|
| 11 |
+
demo.launch()
|
| 12 |
# device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
| 13 |
device = torch.device("cpu")
|
| 14 |
pipe = pipeline(
|