testtest
Browse files
app.py
CHANGED
@@ -1,7 +1,16 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
|
4 |
+
# Load a simple model (fill-mask task as an example)
|
5 |
+
model = pipeline("fill-mask", model="distilroberta-base")
|
6 |
|
7 |
+
# Define the function to use the GPU
|
8 |
+
def predict(text):
|
9 |
+
return model(text)
|
10 |
+
|
11 |
+
# Gradio Interface
|
12 |
+
interface = gr.Interface(fn=predict, inputs="text", outputs="text")
|
13 |
+
|
14 |
+
# Launch the interface
|
15 |
+
if __name__ == "__main__":
|
16 |
+
interface.launch()
|