siddhantuniyal commited on
Commit
4a57049
1 Parent(s): 16bbc96

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -7,17 +7,18 @@ api_key = "AIzaSyCmmus8HFPLXskU170_FR4j2CQeWZBKGMY"
7
  model = genai.GenerativeModel('gemini-pro')
8
  genai.configure(api_key = api_key )
9
 
10
- def get_response(level , number_of_words , how_many_errors , topic):
11
 
12
  try:
13
- response = model.generate_content(f"I have an assignment which should seem like it is made by a {level}, it should have atleast {number_of_words} characters and should contain {how_many_errors} errors. The topic is '{topic}.'")
 
14
  return response.text
15
  except Exception as e:
16
  return "Invalid Input"
17
 
18
  iface = gr.Interface(
19
  fn = get_response,
20
- inputs = ["text" , "text" , "text" , "text"],
21
  outputs = ["text"]
22
  )
23
  iface.launch()
 
7
  model = genai.GenerativeModel('gemini-pro')
8
  genai.configure(api_key = api_key )
9
 
10
+ def get_response(input_text):
11
 
12
  try:
13
+ # response = model.generate_content(f"I have an assignment which should seem like it is made by a {level}, it should have atleast {number_of_words} characters and should contain {how_many_errors} errors. The topic is '{topic}.'")
14
+ response = model.generate_content(f"Give 3 outputs to the following input statement as a list of [sentiment(positive , negative , neutral] , polarity score , issue against the police mentioned] : {input_text}")
15
  return response.text
16
  except Exception as e:
17
  return "Invalid Input"
18
 
19
  iface = gr.Interface(
20
  fn = get_response,
21
+ inputs = ["text"],
22
  outputs = ["text"]
23
  )
24
  iface.launch()