rodrigomasini commited on
Commit
2af419e
·
verified ·
1 Parent(s): 7dc2ad6

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -4
main.py CHANGED
@@ -8,7 +8,7 @@ import json
8
  import tiktoken
9
 
10
 
11
- # --- Core Helper Functions (Preserved from original script) ---
12
 
13
  def is_file_type(file_path: str, file_extension: str) -> bool:
14
  """Check if the file has the specified file extension."""
@@ -65,7 +65,7 @@ def is_test_file(file_content: str, lang: str) -> bool:
65
  return False
66
 
67
 
68
- # --- New Token Calculation Function ---
69
  def get_token_count(text: str) -> int:
70
  """Calculates the number of tokens in a string using the cl100k_base encoding."""
71
  try:
@@ -77,7 +77,7 @@ def get_token_count(text: str) -> int:
77
  return 0
78
 
79
 
80
- # --- Core Processing Logic (Adapted for UI Integration) ---
81
 
82
  def download_and_process_repo(repo_url: str, branch_or_tag: str, log: ui.log) -> str | None:
83
  """
@@ -225,4 +225,4 @@ def main_page():
225
 
226
 
227
  # NiceGUI application on port 8080
228
- ui.run(host='0.0.0.0', port=8080, storage_secret='MAGIC')
 
8
  import tiktoken
9
 
10
 
11
+ # --- Core Helper Functions ---
12
 
13
  def is_file_type(file_path: str, file_extension: str) -> bool:
14
  """Check if the file has the specified file extension."""
 
65
  return False
66
 
67
 
68
+ # --- Token Calculation Function ---
69
  def get_token_count(text: str) -> int:
70
  """Calculates the number of tokens in a string using the cl100k_base encoding."""
71
  try:
 
77
  return 0
78
 
79
 
80
+ # --- Core Processing Logic ---
81
 
82
  def download_and_process_repo(repo_url: str, branch_or_tag: str, log: ui.log) -> str | None:
83
  """
 
225
 
226
 
227
  # NiceGUI application on port 8080
228
+ ui.run()