Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,7 @@
|
|
1 |
-
# app.py
|
2 |
import os
|
3 |
import torch
|
4 |
import gradio as gr
|
5 |
from huggingface_hub import hf_hub_download, snapshot_download
|
6 |
-
from importlib.util import spec_from_file_location, module_from_spec
|
7 |
import sys
|
8 |
|
9 |
def setup_cognitive_net():
|
@@ -11,9 +9,12 @@ def setup_cognitive_net():
|
|
11 |
# Download repository content
|
12 |
repo_path = snapshot_download(repo_id="VLabTech/cognitive_net")
|
13 |
|
14 |
-
#
|
15 |
-
sys.path
|
16 |
-
|
|
|
|
|
|
|
17 |
return DynamicCognitiveNet
|
18 |
|
19 |
def predict(input_text):
|
|
|
|
|
1 |
import os
|
2 |
import torch
|
3 |
import gradio as gr
|
4 |
from huggingface_hub import hf_hub_download, snapshot_download
|
|
|
5 |
import sys
|
6 |
|
7 |
def setup_cognitive_net():
|
|
|
9 |
# Download repository content
|
10 |
repo_path = snapshot_download(repo_id="VLabTech/cognitive_net")
|
11 |
|
12 |
+
# Add the repository path to Python path so we can import the package
|
13 |
+
if repo_path not in sys.path:
|
14 |
+
sys.path.insert(0, repo_path)
|
15 |
+
|
16 |
+
# Import the package
|
17 |
+
from network import DynamicCognitiveNet
|
18 |
return DynamicCognitiveNet
|
19 |
|
20 |
def predict(input_text):
|