Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,19 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
# Laden des GPT-Modells
|
4 |
-
model =
|
5 |
|
6 |
-
#
|
7 |
-
|
|
|
|
|
|
|
|
|
8 |
|
9 |
# Starten der Gradio-App
|
10 |
interface.launch()
|
11 |
|
12 |
|
13 |
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
|
4 |
+
# Laden des GPT-Modells mit Hugging Face Pipeline
|
5 |
+
model = pipeline("text-generation", model="Loewolf/GPT_1")
|
6 |
|
7 |
+
# Definition einer Wrapper-Funktion für das Modell
|
8 |
+
def generate_text(input_text):
|
9 |
+
return model(input_text)[0]['generated_text']
|
10 |
+
|
11 |
+
# Erstellen der Gradio-Schnittstelle
|
12 |
+
interface = gr.Interface(fn=generate_text, inputs="text", outputs="text")
|
13 |
|
14 |
# Starten der Gradio-App
|
15 |
interface.launch()
|
16 |
|
17 |
|
18 |
|
19 |
+
|