prometheus04 commited on
Commit
d68ed5e
·
verified ·
1 Parent(s): 409a5bb

import 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()

Files changed (1) hide show
  1. app.py +0 -0
app.py ADDED
File without changes