Update app.py
Browse files
app.py
CHANGED
@@ -98,13 +98,13 @@ def mode_load(path):
|
|
98 |
|
99 |
@spaces.GPU()
|
100 |
def stream_chat(message, history: list, temperature: float, max_length: int, top_p: float, top_k: int, penalty: float):
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
|
109 |
print(f'message is - {message}')
|
110 |
print(f'history is - {history}')
|
@@ -246,5 +246,5 @@ with gr.Blocks(css=CSS, theme="soft", fill_height=True) as demo:
|
|
246 |
gr.Examples(EXAMPLES, [chat_input])
|
247 |
|
248 |
if __name__ == "__main__":
|
249 |
-
|
250 |
demo.queue(api_open=False).launch(show_api=False, share=False, )#server_name="0.0.0.0", )
|
|
|
98 |
|
99 |
@spaces.GPU()
|
100 |
def stream_chat(message, history: list, temperature: float, max_length: int, top_p: float, top_k: int, penalty: float):
|
101 |
+
|
102 |
+
model = AutoModelForCausalLM.from_pretrained(
|
103 |
+
MODEL_ID,
|
104 |
+
torch_dtype=torch.bfloat16,
|
105 |
+
low_cpu_mem_usage=True,
|
106 |
+
trust_remote_code=True
|
107 |
+
)
|
108 |
|
109 |
print(f'message is - {message}')
|
110 |
print(f'history is - {history}')
|
|
|
246 |
gr.Examples(EXAMPLES, [chat_input])
|
247 |
|
248 |
if __name__ == "__main__":
|
249 |
+
|
250 |
demo.queue(api_open=False).launch(show_api=False, share=False, )#server_name="0.0.0.0", )
|