Spaces:
Runtime error
Runtime error
app.py
Browse filesimport gradio as gr
from transformers import pipeline
# Set up question answering pipeline
qa_pipeline = pipeline("question-answering", model="llama-3.1")
def chatbot(repo_link, question):
# Get repository code
code = get_repo_code(repo_link)
# Analyze code using LLaMA 3.1
analyzed_code = analyze_code(code)
# Answer question
answer = qa_pipeline(question, analyzed_code)
return answer["answer"]
# Create Gradio interface
iface = gr.Interface(
fn=chatbot,
inputs=[
gr.Textbox(label="GitHub Repository Link"),
gr.Textbox(label="Question"),
],
outputs=gr.Textbox(label="Answer"),
title="CodeChatbot",
description="Ask questions about your code!",
)
# Launch Gradio app
iface.launch()