Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ def create_docstring(gen_prompt):
|
|
25 |
return "\"\"\"\n" + gen_prompt + "\n\"\"\"\n\n"
|
26 |
|
27 |
def validate_inputs(gen_prompt, max_tokens, temperature, seed):
|
28 |
-
#
|
29 |
if not gen_prompt:
|
30 |
raise ValueError("English instructions cannot be empty.")
|
31 |
if max_tokens <= 0 or max_tokens > 256:
|
@@ -38,7 +38,7 @@ def validate_inputs(gen_prompt, max_tokens, temperature, seed):
|
|
38 |
def generate_code(gen_prompt, max_tokens, temperature=0.6, seed=42):
|
39 |
validate_inputs(gen_prompt, max_tokens, temperature, seed)
|
40 |
|
41 |
-
#
|
42 |
|
43 |
return generate_code
|
44 |
|
@@ -80,4 +80,5 @@ iface = gr.Interface(
|
|
80 |
description=description,
|
81 |
title=title
|
82 |
)
|
83 |
-
iface.launch()
|
|
|
|
25 |
return "\"\"\"\n" + gen_prompt + "\n\"\"\"\n\n"
|
26 |
|
27 |
def validate_inputs(gen_prompt, max_tokens, temperature, seed):
|
28 |
+
# Add validation logic here
|
29 |
if not gen_prompt:
|
30 |
raise ValueError("English instructions cannot be empty.")
|
31 |
if max_tokens <= 0 or max_tokens > 256:
|
|
|
38 |
def generate_code(gen_prompt, max_tokens, temperature=0.6, seed=42):
|
39 |
validate_inputs(gen_prompt, max_tokens, temperature, seed)
|
40 |
|
41 |
+
# Rest of code generation logic here
|
42 |
|
43 |
return generate_code
|
44 |
|
|
|
80 |
description=description,
|
81 |
title=title
|
82 |
)
|
83 |
+
iface.launch()
|
84 |
+
|