Spaces:
Running
Running
Commit
•
5370db5
1
Parent(s):
a40af16
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,22 @@
|
|
1 |
import os
|
2 |
import subprocess
|
3 |
import streamlit as st
|
4 |
-
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
5 |
-
import black
|
6 |
from pylint import lint
|
7 |
from io import StringIO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
HUGGING_FACE_REPO_URL = "https://huggingface.co/spaces/acecalisto3/DevToolKit"
|
10 |
PROJECT_ROOT = "projects"
|
@@ -34,6 +46,7 @@ class AIAgent:
|
|
34 |
def create_agent_prompt(self):
|
35 |
skills_str = '\n'.join([f"* {skill}" for skill in self.skills])
|
36 |
agent_prompt = f"""
|
|
|
37 |
As an elite expert developer, my name is {self.name}. I possess a comprehensive understanding of the following areas:
|
38 |
{skills_str}
|
39 |
|
|
|
1 |
import os
|
2 |
import subprocess
|
3 |
import streamlit as st
|
|
|
|
|
4 |
from pylint import lint
|
5 |
from io import StringIO
|
6 |
+
import streamlit as st
|
7 |
+
import os
|
8 |
+
import subprocess
|
9 |
+
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
10 |
+
import black
|
11 |
+
|
12 |
+
Returns:
|
13 |
+
The chatbot's response.
|
14 |
+
"""
|
15 |
+
# Load the GPT-2 model which is compatible with AutoModelForCausalLM
|
16 |
+
model_name = 'gpt2'
|
17 |
+
try:
|
18 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
19 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
20 |
|
21 |
HUGGING_FACE_REPO_URL = "https://huggingface.co/spaces/acecalisto3/DevToolKit"
|
22 |
PROJECT_ROOT = "projects"
|
|
|
46 |
def create_agent_prompt(self):
|
47 |
skills_str = '\n'.join([f"* {skill}" for skill in self.skills])
|
48 |
agent_prompt = f"""
|
49 |
+
|
50 |
As an elite expert developer, my name is {self.name}. I possess a comprehensive understanding of the following areas:
|
51 |
{skills_str}
|
52 |
|