Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,8 @@ model = genai.GenerativeModel('gemini-1.5-flash')
|
|
| 12 |
def generate_code(logic, time_complexity, space_complexity, language, others):
|
| 13 |
prompt = f"""
|
| 14 |
Generate Code by considering the following parameter and conditions. The code should not have any comments.
|
| 15 |
-
The code should look like Human typed code.
|
|
|
|
| 16 |
Logic: {logic}
|
| 17 |
Time Complexity: {time_complexity}
|
| 18 |
Space Complexity: {space_complexity}
|
|
@@ -25,7 +26,7 @@ def generate_code(logic, time_complexity, space_complexity, language, others):
|
|
| 25 |
complexity_options = ["O(1)", "O(log N)", "O(N)", "O(N log N)", "O(N²)", "O(N³)", "O(2^N)", "O(N!)"]
|
| 26 |
language_options = ["Python", "Java", "JavaScript", "C", "C++", "Others"]
|
| 27 |
|
| 28 |
-
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 29 |
|
| 30 |
gr.Markdown("# Humanly Code Generator")
|
| 31 |
gr.Markdown("## \n\n<style>h1, h2, h3, h4, h5, h6 { font-size: 40px !important; text-align:center !important; display: block !important;}</style>",label="")
|
|
|
|
| 12 |
def generate_code(logic, time_complexity, space_complexity, language, others):
|
| 13 |
prompt = f"""
|
| 14 |
Generate Code by considering the following parameter and conditions. The code should not have any comments.
|
| 15 |
+
The code should look like Human typed code.
|
| 16 |
+
The naming of the variables and other functions should be small and looks like human created code.
|
| 17 |
Logic: {logic}
|
| 18 |
Time Complexity: {time_complexity}
|
| 19 |
Space Complexity: {space_complexity}
|
|
|
|
| 26 |
complexity_options = ["O(1)", "O(log N)", "O(N)", "O(N log N)", "O(N²)", "O(N³)", "O(2^N)", "O(N!)"]
|
| 27 |
language_options = ["Python", "Java", "JavaScript", "C", "C++", "Others"]
|
| 28 |
|
| 29 |
+
with gr.Blocks(theme=gr.themes.Soft(primary_hue="sky", secondary_hue="blue")) as demo:
|
| 30 |
|
| 31 |
gr.Markdown("# Humanly Code Generator")
|
| 32 |
gr.Markdown("## \n\n<style>h1, h2, h3, h4, h5, h6 { font-size: 40px !important; text-align:center !important; display: block !important;}</style>",label="")
|