vincentiusyoshuac commited on
Commit
c77a21d
·
verified ·
1 Parent(s): d571264

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
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
- # Import module from downloaded path
15
- sys.path.append(repo_path)
16
- from cognitive_net import DynamicCognitiveNet
 
 
 
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):