cakemus commited on
Commit
0394d63
·
1 Parent(s): 4e0781d
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -8,7 +8,8 @@ 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=150, temperature=0.7, top_p=0.9)[0]["generated_text"]
 
12
 
13
 
14
  # Create the Gradio interface
 
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=150, temperature=0.7, top_p=0.9, stop=["."])[0]["generated_text"]
12
+
13
 
14
 
15
  # Create the Gradio interface