mayankchugh-learning commited on
Commit
813c4dc
·
verified ·
1 Parent(s): 872912a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -25
app.py CHANGED
@@ -43,20 +43,6 @@ retriever = vectorstore_persisted.as_retriever(
43
  search_kwargs={'k': 5}
44
  )
45
 
46
-
47
- # Prepare the logging functionality
48
-
49
- log_file = Path("logs/") / f"data_{uuid.uuid4()}.json"
50
- log_folder = log_file.parent
51
-
52
- scheduler = CommitScheduler(
53
- repo_id="---------",
54
- repo_type="dataset",
55
- folder_path=log_folder,
56
- path_in_repo="data",
57
- every=2
58
- )
59
-
60
  # Define the Q&A system message
61
 
62
  qna_system_message = """
@@ -135,17 +121,6 @@ def predict(user_input,company):
135
  # While writing to the log file, ensure that the commit scheduler is locked to avoid parallel
136
  # access
137
 
138
- with scheduler.lock:
139
- with log_file.open("a") as f:
140
- f.write(json.dumps(
141
- {
142
- 'user_input': user_input,
143
- 'retrieved_context': context_for_query,
144
- 'model_response': prediction
145
- }
146
- ))
147
- f.write("\n")
148
-
149
  return prediction
150
 
151
  # Set-up the Gradio UI
 
43
  search_kwargs={'k': 5}
44
  )
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  # Define the Q&A system message
47
 
48
  qna_system_message = """
 
121
  # While writing to the log file, ensure that the commit scheduler is locked to avoid parallel
122
  # access
123
 
 
 
 
 
 
 
 
 
 
 
 
124
  return prediction
125
 
126
  # Set-up the Gradio UI