tharun1507 commited on
Commit
175f49a
·
verified ·
1 Parent(s): 41f2d4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -2,8 +2,8 @@ import gradio as gr
2
  from transformers import pipeline
3
  import time
4
 
5
- # Load the smaller and faster text generation model (DistilGPT-2)
6
- text_generator = pipeline('text-generation', model='distilgpt2')
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` which is defined outside the function.
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` but reassigning `input_list` does not change `my_list`.
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()