got back threading
Browse files
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 |
-
|
121 |
-
|
122 |
-
|
123 |
return streamer
|
124 |
|
125 |
def check_cuda():
|
@@ -131,10 +131,10 @@ def check_cuda():
|
|
131 |
first_time = True
|
132 |
llm_mode = ""
|
133 |
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
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 |
"""
|