Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,13 @@ import json
|
|
2 |
import subprocess
|
3 |
import requests
|
4 |
import gradio as gr
|
|
|
|
|
|
|
|
|
5 |
|
6 |
# URL zum Herunterladen des Modells von Hugging Face
|
7 |
-
url = "https://huggingface.co/TheBloke/
|
8 |
response = requests.get(url)
|
9 |
with open("./model.gguf", mode="wb") as file:
|
10 |
file.write(response.content)
|
@@ -20,7 +24,7 @@ def response(message, history):
|
|
20 |
# Lokale Server-URL
|
21 |
url = "http://0.0.0.0:2600/v1/completions"
|
22 |
body = {
|
23 |
-
"prompt":
|
24 |
"max_tokens": 500,
|
25 |
"echo": False,
|
26 |
"stream": True
|
|
|
2 |
import subprocess
|
3 |
import requests
|
4 |
import gradio as gr
|
5 |
+
import os
|
6 |
+
|
7 |
+
# Laden der geheimen Umgebungsvariablen für den Systemprompt
|
8 |
+
SYSTEM_PROMPT_SECRET = os.environ.get('HF_SYSTEM_PROMPT_SECRET')
|
9 |
|
10 |
# URL zum Herunterladen des Modells von Hugging Face
|
11 |
+
url = "https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q4_0.gguf?download=true"
|
12 |
response = requests.get(url)
|
13 |
with open("./model.gguf", mode="wb") as file:
|
14 |
file.write(response.content)
|
|
|
24 |
# Lokale Server-URL
|
25 |
url = "http://0.0.0.0:2600/v1/completions"
|
26 |
body = {
|
27 |
+
"prompt": SYSTEM_PROMPT_SECRET + message, # Hinzufügen des Systemprompts
|
28 |
"max_tokens": 500,
|
29 |
"echo": False,
|
30 |
"stream": True
|