neo125m
Browse files
app.py
CHANGED
@@ -6,7 +6,8 @@ from spaces import GPU # Import the GPU decorator for ZeroGPU
|
|
6 |
@GPU
|
7 |
def generate_text(prompt):
|
8 |
# Load the model within the function so that it only runs on GPU when the function is called
|
9 |
-
model = pipeline("text-generation", model="
|
|
|
10 |
return model(prompt, max_length=50)[0]["generated_text"]
|
11 |
|
12 |
# Create the Gradio interface
|
|
|
6 |
@GPU
|
7 |
def generate_text(prompt):
|
8 |
# Load the model within the function so that it only runs on GPU when the function is called
|
9 |
+
model = pipeline("text-generation", model="EleutherAI/gpt-neo-125M", device=0)
|
10 |
+
|
11 |
return model(prompt, max_length=50)[0]["generated_text"]
|
12 |
|
13 |
# Create the Gradio interface
|