Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# Load the TinyLlama model for text generation
|
5 |
-
pipe = pipeline("text-generation", model="TinyLlama/TinyLlama_v1.1")
|
6 |
|
7 |
# Define the prediction function
|
8 |
def generate_text(prompt, max_length=128, temperature=1.0, top_p=0.95):
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
# Load the TinyLlama model for text generation
|
5 |
+
pipe = pipeline("text-generation", model="TinyLlama/TinyLlama_v1.1").to("cuda")
|
6 |
|
7 |
# Define the prediction function
|
8 |
def generate_text(prompt, max_length=128, temperature=1.0, top_p=0.95):
|