Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,8 @@ import gradio as gr
|
|
| 2 |
from transformers import pipeline
|
| 3 |
import time
|
| 4 |
|
| 5 |
-
# Load the
|
| 6 |
-
text_generator = pipeline('text-generation', model='
|
| 7 |
|
| 8 |
def get_completion(code_snippet):
|
| 9 |
print("Received code snippet, starting processing...")
|
|
@@ -19,7 +19,7 @@ def get_completion(code_snippet):
|
|
| 19 |
foo()
|
| 20 |
print(x)
|
| 21 |
Expected output: 5
|
| 22 |
-
Explanation: The `global` keyword allows `foo` to modify the variable `x`
|
| 23 |
|
| 24 |
Example 2:
|
| 25 |
def modify_list(input_list):
|
|
@@ -29,7 +29,7 @@ def get_completion(code_snippet):
|
|
| 29 |
modify_list(my_list)
|
| 30 |
print(my_list)
|
| 31 |
Expected output: [0, 4]
|
| 32 |
-
Explanation: The function modifies the original list by appending `4`
|
| 33 |
|
| 34 |
Example 3:
|
| 35 |
print('hello')
|
|
@@ -69,4 +69,3 @@ iface = gr.Interface(
|
|
| 69 |
)
|
| 70 |
|
| 71 |
iface.launch()
|
| 72 |
-
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
import time
|
| 4 |
|
| 5 |
+
# Load the GPT-Neo model for text generation
|
| 6 |
+
text_generator = pipeline('text-generation', model='EleutherAI/gpt-neo-125M')
|
| 7 |
|
| 8 |
def get_completion(code_snippet):
|
| 9 |
print("Received code snippet, starting processing...")
|
|
|
|
| 19 |
foo()
|
| 20 |
print(x)
|
| 21 |
Expected output: 5
|
| 22 |
+
Explanation: The `global` keyword allows `foo` to modify the variable `x`.
|
| 23 |
|
| 24 |
Example 2:
|
| 25 |
def modify_list(input_list):
|
|
|
|
| 29 |
modify_list(my_list)
|
| 30 |
print(my_list)
|
| 31 |
Expected output: [0, 4]
|
| 32 |
+
Explanation: The function modifies the original list by appending `4`.
|
| 33 |
|
| 34 |
Example 3:
|
| 35 |
print('hello')
|
|
|
|
| 69 |
)
|
| 70 |
|
| 71 |
iface.launch()
|
|
|