Spaces:
Runtime error
Runtime error
Update app.py (#8)
Browse files- Update app.py (43c456bed7231cea82b39d36f6afb2e043792dbb)
app.py
CHANGED
|
@@ -1,14 +1,13 @@
|
|
| 1 |
-
# app.py
|
| 2 |
from core.directives import CoreDirectives
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
-
class DeepSiteBuddy
|
| 6 |
def __init__(self):
|
| 7 |
self.directives = CoreDirectives()
|
| 8 |
self.personality_state = {}
|
| 9 |
self.model = pipeline("text-generation", model="gpt2") # or your chosen model
|
| 10 |
|
| 11 |
-
|
| 12 |
"""
|
| 13 |
Core logic to interpret and fulfill user intent.
|
| 14 |
Automatically detects if user wants to code, debug, analyze, etc.
|
|
@@ -21,11 +20,11 @@ class DeepSiteBuddy
|
|
| 21 |
else:
|
| 22 |
return self._general_response(user_input)
|
| 23 |
|
| 24 |
-
|
| 25 |
return "🔧 Code analysis module active. I'll detect language, find issues, and fix them automatically."
|
| 26 |
|
| 27 |
-
|
| 28 |
return "🚀 Starting build process. Setting up project structure and configurations automatically."
|
| 29 |
|
| 30 |
-
|
| 31 |
-
return self.model(user_input, max_length=200)[0]["generated_text"]
|
|
|
|
|
|
|
| 1 |
from core.directives import CoreDirectives
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
class DeepSiteBuddy:
|
| 5 |
def __init__(self):
|
| 6 |
self.directives = CoreDirectives()
|
| 7 |
self.personality_state = {}
|
| 8 |
self.model = pipeline("text-generation", model="gpt2") # or your chosen model
|
| 9 |
|
| 10 |
+
def handle_intent(self, user_input):
|
| 11 |
"""
|
| 12 |
Core logic to interpret and fulfill user intent.
|
| 13 |
Automatically detects if user wants to code, debug, analyze, etc.
|
|
|
|
| 20 |
else:
|
| 21 |
return self._general_response(user_input)
|
| 22 |
|
| 23 |
+
def _handle_code_task(self, user_input):
|
| 24 |
return "🔧 Code analysis module active. I'll detect language, find issues, and fix them automatically."
|
| 25 |
|
| 26 |
+
def _handle_build_task(self, user_input):
|
| 27 |
return "🚀 Starting build process. Setting up project structure and configurations automatically."
|
| 28 |
|
| 29 |
+
def _general_response(self, user_input):
|
| 30 |
+
return self.model(user_input, max_length=200)[0]["generated_text"]
|