kdevoe commited on
Commit
8fe5ece
·
1 Parent(s): 2cf002f

Changing max length to 100

Browse files
Files changed (2) hide show
  1. .gitignore +1 -0
  2. app.py +1 -1
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ tinyllama_env
app.py CHANGED
@@ -8,7 +8,7 @@ pipe = pipeline("text-generation", model="TinyLlama/TinyLlama-1.1B-Chat-v1.0")
8
  # Define the inference function
9
  def generate_text(prompt):
10
  start_time = time.time()
11
- results = pipe(prompt, max_length=50, num_return_sequences=1)
12
  end_time = time.time()
13
  response_time = end_time - start_time
14
  return results[0]['generated_text'], f"{response_time:.2f} seconds"
 
8
  # Define the inference function
9
  def generate_text(prompt):
10
  start_time = time.time()
11
+ results = pipe(prompt, max_length=100, num_return_sequences=1)
12
  end_time = time.time()
13
  response_time = end_time - start_time
14
  return results[0]['generated_text'], f"{response_time:.2f} seconds"