Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,15 +11,6 @@ import importlib
|
|
| 11 |
import os
|
| 12 |
from transformers import AutoModelForSequenceClassification, pipeline, AutoTokenizer
|
| 13 |
|
| 14 |
-
# Load the tokenizer explicitly
|
| 15 |
-
tokenizer = AutoTokenizer.from_pretrained("microsoft/CodeGPT-small-py", clean_up_tokenization_spaces=True)
|
| 16 |
-
|
| 17 |
-
# Initialize the model
|
| 18 |
-
model = AutoModelForSequenceClassification.from_pretrained("microsoft/CodeGPT-small-py") # Use a public model
|
| 19 |
-
|
| 20 |
-
# Initialize the pipeline
|
| 21 |
-
code_generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 22 |
-
|
| 23 |
# Initialize Flask app
|
| 24 |
app = Flask(__name__)
|
| 25 |
app.config['SECRET_KEY'] = 'your-secret-key' # Replace with a strong secret key
|
|
@@ -126,6 +117,15 @@ class ExamplePlugin:
|
|
| 126 |
plugin_manager = PluginManager()
|
| 127 |
plugin_manager.load_plugins()
|
| 128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
# AI Assistant
|
| 130 |
model = AutoModelForSequenceClassification.from_pretrained("microsoft/CodeGPT-small-py")
|
| 131 |
codex_pipeline = pipeline("text-generation", model=model)
|
|
|
|
| 11 |
import os
|
| 12 |
from transformers import AutoModelForSequenceClassification, pipeline, AutoTokenizer
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# Initialize Flask app
|
| 15 |
app = Flask(__name__)
|
| 16 |
app.config['SECRET_KEY'] = 'your-secret-key' # Replace with a strong secret key
|
|
|
|
| 117 |
plugin_manager = PluginManager()
|
| 118 |
plugin_manager.load_plugins()
|
| 119 |
|
| 120 |
+
# Load the tokenizer explicitly
|
| 121 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/CodeGPT-small-py", clean_up_tokenization_spaces=True)
|
| 122 |
+
|
| 123 |
+
# Initialize the model
|
| 124 |
+
model = AutoModelForSequenceClassification.from_pretrained("microsoft/CodeGPT-small-py") # Use a public model
|
| 125 |
+
|
| 126 |
+
# Initialize the pipeline
|
| 127 |
+
code_generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 128 |
+
|
| 129 |
# AI Assistant
|
| 130 |
model = AutoModelForSequenceClassification.from_pretrained("microsoft/CodeGPT-small-py")
|
| 131 |
codex_pipeline = pipeline("text-generation", model=model)
|