Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,9 +28,20 @@ def code_summarizer(code):
|
|
| 28 |
return summary[0]['summary_text']
|
| 29 |
|
| 30 |
def call_examples():
|
| 31 |
-
examples = [['''def findAverage(list):
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
return examples
|
| 35 |
|
| 36 |
gr.Interface(fn=code_summarizer,
|
|
@@ -44,6 +55,6 @@ gr.Interface(fn=code_summarizer,
|
|
| 44 |
label='CODE SUMMARY'),
|
| 45 |
title='Code Summarizer From CodeTrans',
|
| 46 |
description='Summarize any Python code',
|
| 47 |
-
theme='dark',
|
| 48 |
examples=call_examples(),
|
| 49 |
allow_flagging='never').launch(inbrowser=True)
|
|
|
|
| 28 |
return summary[0]['summary_text']
|
| 29 |
|
| 30 |
def call_examples():
|
| 31 |
+
examples = [['''def findAverage(list):
|
| 32 |
+
sum = 0.
|
| 33 |
+
for x in list:
|
| 34 |
+
sum = sum + x
|
| 35 |
+
average = sum / len(list)
|
| 36 |
+
return average'''],
|
| 37 |
+
['''def findMax(list):
|
| 38 |
+
max = list[0]
|
| 39 |
+
for x in list:
|
| 40 |
+
if x > max:
|
| 41 |
+
max = x
|
| 42 |
+
return max'''],
|
| 43 |
+
['''def findRange(list):
|
| 44 |
+
return max(list)-min(list)''']]
|
| 45 |
return examples
|
| 46 |
|
| 47 |
gr.Interface(fn=code_summarizer,
|
|
|
|
| 55 |
label='CODE SUMMARY'),
|
| 56 |
title='Code Summarizer From CodeTrans',
|
| 57 |
description='Summarize any Python code',
|
| 58 |
+
theme='dark-peach',
|
| 59 |
examples=call_examples(),
|
| 60 |
allow_flagging='never').launch(inbrowser=True)
|