sandz7 commited on
Commit
705763e
Β·
1 Parent(s): 0a7e6ca

got back threading

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -6,7 +6,7 @@ import os
6
  from threading import Thread
7
  from openai import OpenAI
8
  import spaces
9
- import multiprocessing as mp
10
  import sys
11
 
12
  # Init ZeroGPU
@@ -117,9 +117,9 @@ def llama_generation(input_text: str,
117
  # thread.start()
118
 
119
  # Multiprocessing to avoid pickle errors
120
- process = mp.Process(target=llama_model.generate, kwargs=generate_kwargs)
121
- process.start()
122
- process.join()
123
  return streamer
124
 
125
  def check_cuda():
@@ -131,10 +131,10 @@ def check_cuda():
131
  first_time = True
132
  llm_mode = ""
133
 
134
- async def bot_comms(input_text: str,
135
- history: list,
136
- temperature: float,
137
- max_new_tokens: int):
138
  """
139
  The connection between gradio and the LLM's
140
  """
 
6
  from threading import Thread
7
  from openai import OpenAI
8
  import spaces
9
+ # import multiprocessing as mp
10
  import sys
11
 
12
  # Init ZeroGPU
 
117
  # thread.start()
118
 
119
  # Multiprocessing to avoid pickle errors
120
+ thread = Thread(target=llama_model.generate, kwargs=generate_kwargs)
121
+ thread.start()
122
+ thread.join()
123
  return streamer
124
 
125
  def check_cuda():
 
131
  first_time = True
132
  llm_mode = ""
133
 
134
+ def bot_comms(input_text: str,
135
+ history: list,
136
+ temperature: float,
137
+ max_new_tokens: int):
138
  """
139
  The connection between gradio and the LLM's
140
  """