cbensimon HF staff commited on
Commit
dc791b7
·
verified ·
1 Parent(s): f9eafe3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -21,9 +21,7 @@ def model_inference(
21
  input_dict, history, decoding_strategy, temperature, max_new_tokens,
22
  repetition_penalty, top_p, progress=gr.Progress(track_tqdm=True)
23
  ):
24
- buffer = "Thinking... "
25
-
26
- yield buffer
27
 
28
  t0 = time.perf_counter()
29
  text = input_dict["text"]
@@ -77,11 +75,13 @@ def model_inference(
77
  generation_args = dict(inputs, streamer=streamer, max_new_tokens=max_new_tokens)
78
  generated_text = ""
79
 
80
- print("model.generate")
81
  thread = Thread(target=model.generate, kwargs=generation_args)
82
  thread.start()
83
- thread.join()
84
-
 
 
 
85
 
86
  for new_text in streamer:
87
 
 
21
  input_dict, history, decoding_strategy, temperature, max_new_tokens,
22
  repetition_penalty, top_p, progress=gr.Progress(track_tqdm=True)
23
  ):
24
+ yield "Processing ..."
 
 
25
 
26
  t0 = time.perf_counter()
27
  text = input_dict["text"]
 
75
  generation_args = dict(inputs, streamer=streamer, max_new_tokens=max_new_tokens)
76
  generated_text = ""
77
 
 
78
  thread = Thread(target=model.generate, kwargs=generation_args)
79
  thread.start()
80
+ # thread.join()
81
+
82
+ yield "Thinking ..."
83
+
84
+ buffer = ""
85
 
86
  for new_text in streamer:
87