not-lain commited on
Commit
43ae797
β€’
1 Parent(s): 3afa221

🌘wπŸŒ–

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ import torch
8
  from threading import Thread
9
  from sentence_transformers import SentenceTransformer
10
  from datasets import load_dataset
11
-
12
 
13
  token = os.environ["HF_TOKEN"]
14
  model = AutoModelForCausalLM.from_pretrained(
@@ -96,7 +96,7 @@ def talk(message, history):
96
  print("initializing thread ...")
97
  t = Thread(target=model.generate, kwargs=generate_kwargs)
98
  t.start()
99
-
100
  # Initialize an empty string to store the generated text
101
  partial_text = ""
102
  for new_text in streamer:
 
8
  from threading import Thread
9
  from sentence_transformers import SentenceTransformer
10
  from datasets import load_dataset
11
+ import time
12
 
13
  token = os.environ["HF_TOKEN"]
14
  model = AutoModelForCausalLM.from_pretrained(
 
96
  print("initializing thread ...")
97
  t = Thread(target=model.generate, kwargs=generate_kwargs)
98
  t.start()
99
+ time.sleep(1)
100
  # Initialize an empty string to store the generated text
101
  partial_text = ""
102
  for new_text in streamer: