Saif Rehman Nasir commited on
Commit
4fe53d8
·
1 Parent(s): 076f151

Refactor code

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -290,8 +290,12 @@ def create_interface():
290
 
291
  def master_decision(message):
292
  decision_response = ""
293
- judge_main_message = f"Here is a query: '{message}', Determine if this query is asking about one of the topics included in the list below. If it is, please directly provide only one name of the topic; otherwise, you reply 'no'. The list of topics is: [movie, sing]"
294
- m_message = [{"role": "user", "content": judge_main_message}]
 
 
 
 
295
  for m in client.chat_completion(
296
  m_message,
297
  stream=True,
@@ -304,7 +308,7 @@ def master_decision(message):
304
  movie_client = Client("ironserengety/movies-recommender")
305
  result = movie_client.predict(
306
  message=message,
307
- system_message="You are a movie recommender named 'Exodia'. You are extremely reliable. You always mention your name in the beginning of conversation. You will provide me with answers from the given info. Give not more than 3 choices and make sure that answers are complete sentences.",
308
  max_tokens=512,
309
  temperature=0.7,
310
  top_p=0.95,
 
290
 
291
  def master_decision(message):
292
  decision_response = ""
293
+ judge_system_message = """You are helpful assistant. You will be given queries from the user and you decide on which domain the query belongs to. You have three domains : ["movies","music","others"]. If you don't know about the domain of a query, it is to be classified as "others". Please give a one word answer in smaller caps."""
294
+
295
+ m_message = [
296
+ {"role":"system","content":judge_system_message},
297
+ {"role": "user", "content": message}
298
+ ]
299
  for m in client.chat_completion(
300
  m_message,
301
  stream=True,
 
308
  movie_client = Client("ironserengety/movies-recommender")
309
  result = movie_client.predict(
310
  message=message,
311
+ system_message="You are a movie recommender named 'Exodia'. You are extremely reliable. You always mention your name in the beginning of conversation. You will provide me with answers from the given info. Give not more than 3 choices and make sure that answers are complete sentences. Give short one-line descriptions of each sentence.",
312
  max_tokens=512,
313
  temperature=0.7,
314
  top_p=0.95,