Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import os
|
|
| 2 |
import json
|
| 3 |
import gradio as gr
|
| 4 |
from llama_cpp import Llama
|
|
|
|
| 5 |
|
| 6 |
# Get environment variables
|
| 7 |
model_id = os.getenv('MODEL')
|
|
@@ -34,6 +35,7 @@ llm = Llama(model_path="/home/user/.cache/huggingface/hub/models--LSX-UniWue--LL
|
|
| 34 |
chat_format=chat_template)
|
| 35 |
|
| 36 |
# Function for streaming chat completions
|
|
|
|
| 37 |
def chat_stream_completion(message, history):
|
| 38 |
#messages_prompts = [{"role": "system", "content": system_prompt}]
|
| 39 |
messages_prompts = []
|
|
|
|
| 2 |
import json
|
| 3 |
import gradio as gr
|
| 4 |
from llama_cpp import Llama
|
| 5 |
+
import spaces
|
| 6 |
|
| 7 |
# Get environment variables
|
| 8 |
model_id = os.getenv('MODEL')
|
|
|
|
| 35 |
chat_format=chat_template)
|
| 36 |
|
| 37 |
# Function for streaming chat completions
|
| 38 |
+
@spaces.GPU
|
| 39 |
def chat_stream_completion(message, history):
|
| 40 |
#messages_prompts = [{"role": "system", "content": system_prompt}]
|
| 41 |
messages_prompts = []
|