Spaces:
Sleeping
Sleeping
Commit
·
0bc3a97
1
Parent(s):
c253db1
Update app.py
Browse files
app.py
CHANGED
@@ -7,14 +7,14 @@ api_key = "AIzaSyCmmus8HFPLXskU170_FR4j2CQeWZBKGMY"
|
|
7 |
model = genai.GenerativeModel('gemini-pro')
|
8 |
genai.configure(api_key = api_key )
|
9 |
|
10 |
-
def get_response(
|
11 |
|
12 |
-
response = model.generate_content(
|
13 |
return response.text
|
14 |
|
15 |
iface = gr.Interface(
|
16 |
fn = get_response,
|
17 |
-
inputs = ["text"],
|
18 |
outputs = ["text"]
|
19 |
)
|
20 |
iface.launch()
|
|
|
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 |
+
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}.'")
|
13 |
return response.text
|
14 |
|
15 |
iface = gr.Interface(
|
16 |
fn = get_response,
|
17 |
+
inputs = ["text" , "text" , "text" , "text"],
|
18 |
outputs = ["text"]
|
19 |
)
|
20 |
iface.launch()
|