Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import os
|
|
7 |
import logging
|
8 |
from unsloth import FastLanguageModel
|
9 |
import subprocess
|
10 |
-
|
11 |
# Set up logging to file
|
12 |
log_file_path = "app.log" # Name of your log file
|
13 |
logging.basicConfig(
|
@@ -140,22 +140,5 @@ iface = gr.Interface(
|
|
140 |
],
|
141 |
outputs=gr.Textbox(label="output", lines=23),
|
142 |
title="Testing",
|
143 |
-
|
144 |
-
)
|
145 |
-
# --- Code to commit the log file to your repo ---
|
146 |
-
try:
|
147 |
-
# Add the log file to the git staging area
|
148 |
-
subprocess.run(['git', 'add', log_file_path])
|
149 |
-
|
150 |
-
# Commit the changes
|
151 |
-
subprocess.run(['git', 'commit', '-m', 'Update log file'])
|
152 |
-
|
153 |
-
# Push the changes to the remote repository (usually 'origin')
|
154 |
-
subprocess.run(['git', 'push'])
|
155 |
-
|
156 |
-
logger.info("Log file committed to the repository.")
|
157 |
-
|
158 |
-
except Exception as e:
|
159 |
-
logger.error(f"Error committing log file: {e}")
|
160 |
-
|
161 |
-
iface.launch(inline=False)
|
|
|
7 |
import logging
|
8 |
from unsloth import FastLanguageModel
|
9 |
import subprocess
|
10 |
+
loler=gr.SimpleCSVLogger()
|
11 |
# Set up logging to file
|
12 |
log_file_path = "app.log" # Name of your log file
|
13 |
logging.basicConfig(
|
|
|
140 |
],
|
141 |
outputs=gr.Textbox(label="output", lines=23),
|
142 |
title="Testing",
|
143 |
+
flagging_callback=SimpleCSVLogger()
|
144 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|