AFischer1985 commited on
Commit
34b1fd2
·
verified ·
1 Parent(s): d41ee7d

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +5 -4
run.py CHANGED
@@ -2,7 +2,7 @@
2
  # Title: German AI-Interface with advanced RAG
3
  # Author: Andreas Fischer
4
  # Date: January 31st, 2023
5
- # Last update: February 22st, 2024
6
  ##########################################################################################
7
 
8
  #https://github.com/abetlen/llama-cpp-python/issues/306
@@ -30,7 +30,7 @@ dbPath = "/home/af/Schreibtisch/Code/gradio/Chroma/db"
30
  onPrem = True if(os.path.exists(dbPath)) else False
31
  if(onPrem==False): dbPath="/home/user/app/db"
32
 
33
- #onPrem=False
34
  print(dbPath)
35
 
36
  #client = chromadb.Client()
@@ -255,7 +255,7 @@ def response(message, history):
255
  if (settings=="Permanent"):
256
  if((len(history)==0)&(os.path.isfile(filename))): history=json.load(open(filename,'r',encoding="utf-8")) # retrieve history (if available)
257
 
258
- system="Du bist ein deutschsprachiges KI-basiertes Assistenzsystem."
259
 
260
  #RAG-layer 0: Intention-RAG
261
  #---------------------------
@@ -318,7 +318,7 @@ def response(message, history):
318
  combination = [' '.join(triplets) for triplets in combination]
319
  #print(combination)
320
  rag="\n\n"
321
- rag += "Beziehe dich in deiner Antwort AUSSCHLIEßLICH auf die folgenden Informationen:\n"
322
  rag += str(texts)
323
  rag += "\n\nIm Folgenden siehst du den jüngsten Dialog-Verlauf:"
324
 
@@ -356,6 +356,7 @@ def response(message, history):
356
 
357
  ## Request response from model
358
  #------------------------------
 
359
  print("AI running on prem!" if(onPrem) else "AI running HFHub!")
360
  if(onPrem==False):
361
  temperature=float(0.9)
 
2
  # Title: German AI-Interface with advanced RAG
3
  # Author: Andreas Fischer
4
  # Date: January 31st, 2023
5
+ # Last update: February 21st, 2024
6
  ##########################################################################################
7
 
8
  #https://github.com/abetlen/llama-cpp-python/issues/306
 
30
  onPrem = True if(os.path.exists(dbPath)) else False
31
  if(onPrem==False): dbPath="/home/user/app/db"
32
 
33
+ onPrem=False
34
  print(dbPath)
35
 
36
  #client = chromadb.Client()
 
255
  if (settings=="Permanent"):
256
  if((len(history)==0)&(os.path.isfile(filename))): history=json.load(open(filename,'r',encoding="utf-8")) # retrieve history (if available)
257
 
258
+ system="Du bist ein deutschsprachiges wortkarges KI-basiertes Assistenzsystem. Fasse dich kurz."
259
 
260
  #RAG-layer 0: Intention-RAG
261
  #---------------------------
 
318
  combination = [' '.join(triplets) for triplets in combination]
319
  #print(combination)
320
  rag="\n\n"
321
+ rag += "Beziehe dich in deiner Fortsetzung des Dialogs AUSSCHLIEßLICH auf die folgenden Informationen:\n"
322
  rag += str(texts)
323
  rag += "\n\nIm Folgenden siehst du den jüngsten Dialog-Verlauf:"
324
 
 
356
 
357
  ## Request response from model
358
  #------------------------------
359
+
360
  print("AI running on prem!" if(onPrem) else "AI running HFHub!")
361
  if(onPrem==False):
362
  temperature=float(0.9)