Spaces:
Runtime error
Runtime error
Commit
·
74e3268
1
Parent(s):
231b1e6
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,19 @@
|
|
1 |
-
|
2 |
import os
|
3 |
-
|
4 |
-
os.system("pip freeze")
|
5 |
import gradio as gr
|
6 |
import requests
|
7 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# Initialize the CodeBERT model and tokenizer
|
10 |
tokenizer = AutoTokenizer.from_pretrained("microsoft/CodeBERT-base")
|
11 |
model = AutoModelForSeq2SeqLM.from_pretrained("microsoft/CodeBERT-base")
|
@@ -47,4 +55,4 @@ gr.Interface(
|
|
47 |
outputs=output_text,
|
48 |
title="Create a Conversational AI Chatbot for Your Public GitHub Repository Codebase",
|
49 |
theme="huggingface_dark",
|
50 |
-
).launch()
|
|
|
|
|
1 |
import os
|
2 |
+
import logging
|
|
|
3 |
import gradio as gr
|
4 |
import requests
|
5 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
6 |
|
7 |
+
debug = True
|
8 |
+
logging_level = logging.DEBUG if debug else logging.INFO
|
9 |
+
logging.basicConfig(level=logging_level)
|
10 |
+
|
11 |
+
os.system("pip install -r requirements.txt")
|
12 |
+
os.system("pip freeze")
|
13 |
+
os.system("pip install gradio==2.3.0")
|
14 |
+
os.system("pip install requests==2.26.0")
|
15 |
+
os.system("pip install transformers==4.11.3")
|
16 |
+
|
17 |
# Initialize the CodeBERT model and tokenizer
|
18 |
tokenizer = AutoTokenizer.from_pretrained("microsoft/CodeBERT-base")
|
19 |
model = AutoModelForSeq2SeqLM.from_pretrained("microsoft/CodeBERT-base")
|
|
|
55 |
outputs=output_text,
|
56 |
title="Create a Conversational AI Chatbot for Your Public GitHub Repository Codebase",
|
57 |
theme="huggingface_dark",
|
58 |
+
).launch()
|