Tejasw1 commited on
Commit
1f2b621
Β·
1 Parent(s): a02c3cf

Upload folder using huggingface_hub

Browse files
__pycache__/gradio_app.cpython-311.pyc ADDED
Binary file (3.96 kB). View file
 
gradio_app.py CHANGED
@@ -18,6 +18,12 @@ client = Client("http://20.83.177.108:8080")
18
 
19
  def run_generation(user_text, top_p, temperature, top_k, max_new_tokens):
20
  # Get the model and tokenizer, and tokenize the user text.
 
 
 
 
 
 
21
  user_text = f"""You are an expert legal assistant with extensive knowledge about Indian law. Your task is to respond to the given query in a consice and factually correct manner. Also mention the relevant sections of the law wherever applicable.
22
  ### Input: {user_text}
23
  ### Response: """
 
18
 
19
  def run_generation(user_text, top_p, temperature, top_k, max_new_tokens):
20
  # Get the model and tokenizer, and tokenize the user text.
21
+
22
+ if len(user_text.strip()) == 0:
23
+ print('blank')
24
+ gr.Warning('Please enter a question to continue')
25
+ return
26
+
27
  user_text = f"""You are an expert legal assistant with extensive knowledge about Indian law. Your task is to respond to the given query in a consice and factually correct manner. Also mention the relevant sections of the law wherever applicable.
28
  ### Input: {user_text}
29
  ### Response: """