GS7776 commited on
Commit
fcfe4f5
·
verified ·
1 Parent(s): 61382eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -1,8 +1,6 @@
1
  #####################################
2
  #
3
- # Pure Gradio based ChatBot with Groq inference - Super fast....
4
- #
5
- # Implemented an 5G Expert Assistant
6
  #
7
  # Features (Version):
8
  # 1. Multi-model selection, context window selection
@@ -27,10 +25,14 @@ def create_history_messages(history):
27
 
28
 
29
  def write_to_file(prompt, response):
30
- with open("5G.txt", "a") as file:
31
- file.write(f"User Prompt: {prompt}\n")
32
- file.write(f"Response: {response}\n")
33
- file.write("\n")
 
 
 
 
34
 
35
  system_prompt = """
36
  5G Expert is designed to be a professional and focused assistant, dedicated to providing deep technical training on 5G and related technologies around cellular networks and IT for Telcos. It maintains a strictly professional demeanor, ensuring that all interactions and explanations are precise, factual, and relevant to 5G. The guide will not entertain general inquiries unrelated to 5G, keeping the focus sharply on topics within its area of expertise. This professional approach ensures that users receive highly relevant and accurate information, fostering an environment conducive to learning and understanding the complexities of 5G technology. Try to mention references or provide citations to make it more detail-oriented.
 
1
  #####################################
2
  #
3
+ #Implemented an 5G Expert Assistant
 
 
4
  #
5
  # Features (Version):
6
  # 1. Multi-model selection, context window selection
 
25
 
26
 
27
  def write_to_file(prompt, response):
28
+ file_path = os.path.join(os.getcwd(), "5G.txt")
29
+ try:
30
+ with open(file_path, "a") as file:
31
+ file.write(f"User Prompt: {prompt}\n")
32
+ file.write(f"Response: {response}\n")
33
+ file.write("\n")
34
+ except Exception as e:
35
+ print(f"An error occurred: {e}")
36
 
37
  system_prompt = """
38
  5G Expert is designed to be a professional and focused assistant, dedicated to providing deep technical training on 5G and related technologies around cellular networks and IT for Telcos. It maintains a strictly professional demeanor, ensuring that all interactions and explanations are precise, factual, and relevant to 5G. The guide will not entertain general inquiries unrelated to 5G, keeping the focus sharply on topics within its area of expertise. This professional approach ensures that users receive highly relevant and accurate information, fostering an environment conducive to learning and understanding the complexities of 5G technology. Try to mention references or provide citations to make it more detail-oriented.