AUMREDKA commited on
Commit
1f7bf1a
·
verified ·
1 Parent(s): 2d1eac6

Update main.py

Browse files

Removed risky function which re-creates project folder structure

Files changed (1) hide show
  1. main.py +1 -29
main.py CHANGED
@@ -39,30 +39,6 @@ def run_flask_frontend():
39
  subprocess.run(["flask", "run", "--host=0.0.0.0", "--port=7860"],
40
  env={**os.environ, "FLASK_APP": "buffalo_rag/frontend/flask_app.py"})
41
 
42
- def create_project_structure():
43
- """Create the project folder structure."""
44
- # Main directories
45
- directories = [
46
- "buffalo_rag",
47
- "buffalo_rag/scraper",
48
- "buffalo_rag/embeddings",
49
- "buffalo_rag/vector_store",
50
- "buffalo_rag/model",
51
- "buffalo_rag/api",
52
- "buffalo_rag/frontend",
53
- "buffalo_rag/utils",
54
- "data",
55
- "data/raw",
56
- "data/processed",
57
- "data/embeddings",
58
- ]
59
-
60
- # Create directories
61
- for directory in directories:
62
- os.makedirs(directory, exist_ok=True)
63
-
64
- print("Project structure created!")
65
-
66
  def build_react_frontend():
67
  """Build the React frontend."""
68
  print("Building React frontend...")
@@ -118,7 +94,6 @@ def wait_for_server(url, timeout=30, interval=1):
118
 
119
  def main():
120
  parser = argparse.ArgumentParser(description="BuffaloRAG - AI Assistant for UB International Students")
121
- parser.add_argument("--setup", action="store_true", help="Create project structure")
122
  parser.add_argument("--flask-setup", action="store_true", help="Setup Flask frontend")
123
  parser.add_argument("--scrape", action="store_true", help="Run web scraper")
124
  parser.add_argument("--build", action="store_true", help="Build embeddings")
@@ -128,10 +103,7 @@ def main():
128
  parser.add_argument("--run", action="store_true", help="Run frontend & backend servers")
129
 
130
  args = parser.parse_args()
131
-
132
- if args.setup or args.all:
133
- create_project_structure()
134
-
135
  if args.flask_setup or args.all or args.run:
136
  # Run the Flask setup script
137
  from setup_flask_templates import setup_flask_templates
 
39
  subprocess.run(["flask", "run", "--host=0.0.0.0", "--port=7860"],
40
  env={**os.environ, "FLASK_APP": "buffalo_rag/frontend/flask_app.py"})
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  def build_react_frontend():
43
  """Build the React frontend."""
44
  print("Building React frontend...")
 
94
 
95
  def main():
96
  parser = argparse.ArgumentParser(description="BuffaloRAG - AI Assistant for UB International Students")
 
97
  parser.add_argument("--flask-setup", action="store_true", help="Setup Flask frontend")
98
  parser.add_argument("--scrape", action="store_true", help="Run web scraper")
99
  parser.add_argument("--build", action="store_true", help="Build embeddings")
 
103
  parser.add_argument("--run", action="store_true", help="Run frontend & backend servers")
104
 
105
  args = parser.parse_args()
106
+
 
 
 
107
  if args.flask_setup or args.all or args.run:
108
  # Run the Flask setup script
109
  from setup_flask_templates import setup_flask_templates