Spaces:
Sleeping
Sleeping
siddhantuniyal
commited on
Commit
•
16bbc96
1
Parent(s):
0bc3a97
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,11 @@ genai.configure(api_key = api_key )
|
|
9 |
|
10 |
def get_response(level , number_of_words , how_many_errors , topic):
|
11 |
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
iface = gr.Interface(
|
16 |
fn = get_response,
|
|
|
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,
|