kwabs22 commited on
Commit
7e572c1
1 Parent(s): 9251e88

file explorer

Browse files
app.py CHANGED
@@ -156,9 +156,10 @@ with gr.Blocks() as demo:
156
  NewConfErrorEditedSplitinputbtn.click(join_lines_after_correct_json_errors, inputs=[NewConfErrorEditedSplitinput], outputs=[NewConfErroroutput])
157
 
158
  with gr.Accordion("My Previous Quick Config Attempts", open=False):
159
- for experimetal_config_name, experimetal_config in ExampleGameConfigs.items():
160
- with gr.Tab(experimetal_config_name):
161
- gr.Code(json.dumps(experimetal_config, default=lambda o: o.__dict__, indent=2), label=experimetal_config_name) #str(experimetal_config)
 
162
 
163
  with gr.Tab("Demo of 'Finished Product Example'"):
164
  gr.HTML("Incomplete")
 
156
  NewConfErrorEditedSplitinputbtn.click(join_lines_after_correct_json_errors, inputs=[NewConfErrorEditedSplitinput], outputs=[NewConfErroroutput])
157
 
158
  with gr.Accordion("My Previous Quick Config Attempts", open=False):
159
+ with gr.Tab("Gemini Examples"):
160
+ for experimetal_config_name, experimetal_config in ExampleGameConfigs.items():
161
+ with gr.Tab(experimetal_config_name):
162
+ gr.Code(json.dumps(experimetal_config, default=lambda o: o.__dict__, indent=2), label=experimetal_config_name) #str(experimetal_config)
163
 
164
  with gr.Tab("Demo of 'Finished Product Example'"):
165
  gr.HTML("Incomplete")
file_explorer_and_upload.py CHANGED
@@ -70,7 +70,16 @@ def view_file(file_path):
70
  return None, None, None, f"Error viewing file: {str(e)}"
71
 
72
  def refresh_file_explorer():
73
- return gr.update()
 
 
 
 
 
 
 
 
 
74
 
75
  def import_config_with_media(zip_path):
76
  global SAVE_DIR
 
70
  return None, None, None, f"Error viewing file: {str(e)}"
71
 
72
  def refresh_file_explorer():
73
+ files = os.listdir(SAVE_DIR)
74
+ return gr.update(value=files)
75
+
76
+ def delete_file(file_path):
77
+ if os.path.exists(file_path):
78
+ os.remove(file_path)
79
+ fileexplorerupdate = refresh_file_explorer()
80
+ return fileexplorerupdate, f"{file_path} has been deleted."
81
+ else:
82
+ return f"{file_path} does not exist."
83
 
84
  def import_config_with_media(zip_path):
85
  global SAVE_DIR
leveraging_machine_learning.py CHANGED
@@ -16,7 +16,7 @@ from relatively_constant_variables import knowledge_base
16
  zero = torch.Tensor([0]).cuda()
17
  print(zero.device) # This will print 'cpu' outside the @spaces.GPU decorated function
18
 
19
- modelnames = ["stvlynn/Gemma-2-2b-Chinese-it", "nbeerbower/mistral-nemo-wissenschaft-12B", "princeton-nlp/gemma-2-9b-it-SimPO", "cognitivecomputations/dolphin-2.9.3-mistral-7B-32k", "01-ai/Yi-Coder-9B-Chat", "ArliAI/Llama-3.1-8B-ArliAI-RPMax-v1.1", "ArliAI/Phi-3.5-mini-3.8B-ArliAI-RPMax-v1.1",
20
  "Qwen/Qwen2.5-7B-Instruct", "Qwen/Qwen2-0.5B-Instruct", "Qwen/Qwen2-1.5B-Instruct", "Qwen/Qwen2-7B-Instruct", "Qwen/Qwen1.5-MoE-A2.7B-Chat", "HuggingFaceTB/SmolLM-135M-Instruct", "microsoft/Phi-3-mini-4k-instruct", "Groq/Llama-3-Groq-8B-Tool-Use", "hugging-quants/Meta-Llama-3.1-8B-Instruct-BNB-NF4",
21
  "SpectraSuite/TriLM_3.9B_Unpacked", "h2oai/h2o-danube3-500m-chat", "OuteAI/Lite-Mistral-150M-v2-Instruct", "Zyphra/Zamba2-1.2B", "anthracite-org/magnum-v2-4b", ]
22
 
 
16
  zero = torch.Tensor([0]).cuda()
17
  print(zero.device) # This will print 'cpu' outside the @spaces.GPU decorated function
18
 
19
+ modelnames = ["stvlynn/Gemma-2-2b-Chinese-it", "unsloth/Llama-3.2-1B-Instruct", "unsloth/Llama-3.2-3B-Instruct", "nbeerbower/mistral-nemo-wissenschaft-12B", "princeton-nlp/gemma-2-9b-it-SimPO", "cognitivecomputations/dolphin-2.9.3-mistral-7B-32k", "01-ai/Yi-Coder-9B-Chat", "ArliAI/Llama-3.1-8B-ArliAI-RPMax-v1.1", "ArliAI/Phi-3.5-mini-3.8B-ArliAI-RPMax-v1.1",
20
  "Qwen/Qwen2.5-7B-Instruct", "Qwen/Qwen2-0.5B-Instruct", "Qwen/Qwen2-1.5B-Instruct", "Qwen/Qwen2-7B-Instruct", "Qwen/Qwen1.5-MoE-A2.7B-Chat", "HuggingFaceTB/SmolLM-135M-Instruct", "microsoft/Phi-3-mini-4k-instruct", "Groq/Llama-3-Groq-8B-Tool-Use", "hugging-quants/Meta-Llama-3.1-8B-Instruct-BNB-NF4",
21
  "SpectraSuite/TriLM_3.9B_Unpacked", "h2oai/h2o-danube3-500m-chat", "OuteAI/Lite-Mistral-150M-v2-Instruct", "Zyphra/Zamba2-1.2B", "anthracite-org/magnum-v2-4b", ]
22
 
ui_gr_media_management.py CHANGED
@@ -97,8 +97,9 @@ def ui_gr_media_management_acc():
97
  label="Select a file to view"
98
  )
99
  with gr.Row():
100
- refresh_button = gr.Button("Refresh", scale=1)
101
  view_button = gr.Button("View File")
 
102
  image_output = gr.Image(label="Image Output", type="pil")
103
  audio_output = gr.Audio(label="Audio Output")
104
  video_output = gr.Video(label="Video Output")
@@ -121,6 +122,12 @@ def ui_gr_media_management_acc():
121
  outputs=file_explorer
122
  )
123
 
 
 
 
 
 
 
124
  with gr.Tab("Batch add files to config"):
125
  gr.HTML("Placeholder for Config parser to allow dropdowns for the media parts of the config inserted to make assigning media quick")
126
  gr.HTML("Placeholder for Config parser to allow for current zerospace creation and placement into the config (LLM can give list of media but still have to figure out workflow from there)")
@@ -424,6 +431,6 @@ print(output)""", language="python")
424
  gr.HTML("https://www.reddit.com/r/singularity/comments/1fknejj/facecamai_lets_anyone_convert_a_single_image_into/ <br>https://www.reddit.com/r/singularity/comments/1fjylow/tripo_v20_is_out_now_you_can_create_stunning_3d/")
425
 
426
  with gr.Tab("Licensing"):
427
- gr.HTML("Need to find the press release to see license eg. https://blackforestlabs.ai/announcing-black-forest-labs/")
428
 
429
  return filemanager
 
97
  label="Select a file to view"
98
  )
99
  with gr.Row():
100
+ refresh_button = gr.Button("Refresh")
101
  view_button = gr.Button("View File")
102
+ delete_button = gr.Button("Delete")
103
  image_output = gr.Image(label="Image Output", type="pil")
104
  audio_output = gr.Audio(label="Audio Output")
105
  video_output = gr.Video(label="Video Output")
 
122
  outputs=file_explorer
123
  )
124
 
125
+ refresh_button.click(
126
+ delete_file,
127
+ inputs=file_explorer,
128
+ outputs=[file_explorer, error_output]
129
+ )
130
+
131
  with gr.Tab("Batch add files to config"):
132
  gr.HTML("Placeholder for Config parser to allow dropdowns for the media parts of the config inserted to make assigning media quick")
133
  gr.HTML("Placeholder for Config parser to allow for current zerospace creation and placement into the config (LLM can give list of media but still have to figure out workflow from there)")
 
431
  gr.HTML("https://www.reddit.com/r/singularity/comments/1fknejj/facecamai_lets_anyone_convert_a_single_image_into/ <br>https://www.reddit.com/r/singularity/comments/1fjylow/tripo_v20_is_out_now_you_can_create_stunning_3d/")
432
 
433
  with gr.Tab("Licensing"):
434
+ gr.HTML("To be continued.... Need to find the press release to see license eg. https://blackforestlabs.ai/announcing-black-forest-labs/")
435
 
436
  return filemanager