Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
|
@@ -44,12 +44,12 @@ def load_llm():
|
|
| 44 |
"text-generation",
|
| 45 |
model=model,
|
| 46 |
tokenizer=tokenizer,
|
| 47 |
-
max_new_tokens=300,
|
| 48 |
-
temperature=0.1,
|
| 49 |
-
repetition_penalty=1.1,
|
| 50 |
return_full_text=False
|
| 51 |
)
|
| 52 |
-
return HuggingFacePipeline(
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
# 2. CODE INGESTION & VECTOR DATABASE
|
| 55 |
|
|
@@ -249,7 +249,7 @@ def get_initial_repo_status():
|
|
| 249 |
return f"β
**Ready!** {file_count} files indexed and loaded."
|
| 250 |
return "β **Empty Database.** Provide a codebase below to begin."
|
| 251 |
|
| 252 |
-
with gr.Blocks(title="Codebase Assistant"
|
| 253 |
with gr.Row():
|
| 254 |
with gr.Column(scale=1):
|
| 255 |
gr.Markdown("# π¦ RepoRaptor\n**Your personal AI codebase expert.**")
|
|
@@ -278,7 +278,7 @@ with gr.Blocks(title="Codebase Assistant", css=custom_css, theme=gr.themes.Soft(
|
|
| 278 |
|
| 279 |
with gr.Column(scale=3):
|
| 280 |
gr.Markdown("### π» Chat Interface\nAsk architecture questions, find bugs, or request code explanations. I will **only** answer questions related to code.")
|
| 281 |
-
chatbot = gr.Chatbot(height=600, show_label=False
|
| 282 |
|
| 283 |
with gr.Row():
|
| 284 |
msg = gr.Textbox(placeholder="E.g., What does the main function do? (Press Enter to send)", show_label=False, scale=4)
|
|
@@ -288,4 +288,4 @@ with gr.Blocks(title="Codebase Assistant", css=custom_css, theme=gr.themes.Soft(
|
|
| 288 |
clear.click(lambda: None, None, chatbot, queue=False)
|
| 289 |
|
| 290 |
if __name__ == "__main__":
|
| 291 |
-
demo.launch(server_name="0.0.0.0")
|
|
|
|
| 44 |
"text-generation",
|
| 45 |
model=model,
|
| 46 |
tokenizer=tokenizer,
|
|
|
|
|
|
|
|
|
|
| 47 |
return_full_text=False
|
| 48 |
)
|
| 49 |
+
return HuggingFacePipeline(
|
| 50 |
+
pipeline=pipe,
|
| 51 |
+
pipeline_kwargs={"max_new_tokens": 300, "temperature": 0.1, "repetition_penalty": 1.1}
|
| 52 |
+
)
|
| 53 |
|
| 54 |
# 2. CODE INGESTION & VECTOR DATABASE
|
| 55 |
|
|
|
|
| 249 |
return f"β
**Ready!** {file_count} files indexed and loaded."
|
| 250 |
return "β **Empty Database.** Provide a codebase below to begin."
|
| 251 |
|
| 252 |
+
with gr.Blocks(title="Codebase Assistant") as demo:
|
| 253 |
with gr.Row():
|
| 254 |
with gr.Column(scale=1):
|
| 255 |
gr.Markdown("# π¦ RepoRaptor\n**Your personal AI codebase expert.**")
|
|
|
|
| 278 |
|
| 279 |
with gr.Column(scale=3):
|
| 280 |
gr.Markdown("### π» Chat Interface\nAsk architecture questions, find bugs, or request code explanations. I will **only** answer questions related to code.")
|
| 281 |
+
chatbot = gr.Chatbot(height=600, show_label=False)
|
| 282 |
|
| 283 |
with gr.Row():
|
| 284 |
msg = gr.Textbox(placeholder="E.g., What does the main function do? (Press Enter to send)", show_label=False, scale=4)
|
|
|
|
| 288 |
clear.click(lambda: None, None, chatbot, queue=False)
|
| 289 |
|
| 290 |
if __name__ == "__main__":
|
| 291 |
+
demo.launch(server_name="0.0.0.0", css=custom_css, theme=gr.themes.Soft())
|