Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
2 |
import gradio as gr
|
|
|
|
|
|
|
|
|
3 |
|
4 |
# Load pre-trained GPT-2 model and tokenizer
|
5 |
model_name = "gpt2" # You can use other models like "gpt2-medium", "gpt2-large", etc.
|
@@ -16,4 +20,3 @@ def generate_response(query):
|
|
16 |
# Interface setup
|
17 |
iface = gr.Interface(fn=generate_response, inputs="text", outputs="text", title="Generative AI Query Response")
|
18 |
iface.launch()
|
19 |
-
|
|
|
1 |
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
2 |
import gradio as gr
|
3 |
+
import subprocess # Import subprocess module to run shell commands
|
4 |
+
|
5 |
+
# Install Rust using shell command
|
6 |
+
subprocess.run(['curl', '--proto', '=https', '--tlsv1.2', '-sSf', 'https://sh.rustup.rs', '|', 'sh'])
|
7 |
|
8 |
# Load pre-trained GPT-2 model and tokenizer
|
9 |
model_name = "gpt2" # You can use other models like "gpt2-medium", "gpt2-large", etc.
|
|
|
20 |
# Interface setup
|
21 |
iface = gr.Interface(fn=generate_response, inputs="text", outputs="text", title="Generative AI Query Response")
|
22 |
iface.launch()
|
|