TheMaisk commited on
Commit
39c9e63
1 Parent(s): 0b8d07b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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/dolphin-2.6-mistral-7B-GGUF/blob/main/dolphin-2.6-mistral-7b.Q6_K.gguf?download=true"
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": "[INST]" + message + "[/INST]",
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