fix time
Browse files- Kaggle_API.py +4 -2
- app.py +1 -1
Kaggle_API.py
CHANGED
|
@@ -95,6 +95,9 @@ class API_Connection:
|
|
| 95 |
if len(output_image_name) == 0:
|
| 96 |
return False, rf"Missing Output"
|
| 97 |
|
|
|
|
|
|
|
|
|
|
| 98 |
dataset_path = self.correct_path(rf"{self.PROJECT_PATH}\{self.DATASET_NAME}")
|
| 99 |
notebook_path = self.correct_path(rf"{self.PROJECT_PATH}\notebook")
|
| 100 |
|
|
@@ -108,7 +111,7 @@ class API_Connection:
|
|
| 108 |
|
| 109 |
data = [
|
| 110 |
{
|
| 111 |
-
"time":
|
| 112 |
"status": "IDLE",
|
| 113 |
"edit": edit_instruction,
|
| 114 |
"input_image_path": input_image_name,
|
|
@@ -126,7 +129,6 @@ class API_Connection:
|
|
| 126 |
)
|
| 127 |
|
| 128 |
# run notebook
|
| 129 |
-
print(rf"Current Time: {data["time"]}")
|
| 130 |
print(self.run(notebook_path))
|
| 131 |
|
| 132 |
number_of_checks = 0
|
|
|
|
| 95 |
if len(output_image_name) == 0:
|
| 96 |
return False, rf"Missing Output"
|
| 97 |
|
| 98 |
+
current_time = self.get_current_time()
|
| 99 |
+
print(rf"Start Time : {current_time}")
|
| 100 |
+
|
| 101 |
dataset_path = self.correct_path(rf"{self.PROJECT_PATH}\{self.DATASET_NAME}")
|
| 102 |
notebook_path = self.correct_path(rf"{self.PROJECT_PATH}\notebook")
|
| 103 |
|
|
|
|
| 111 |
|
| 112 |
data = [
|
| 113 |
{
|
| 114 |
+
"time": current_time,
|
| 115 |
"status": "IDLE",
|
| 116 |
"edit": edit_instruction,
|
| 117 |
"input_image_path": input_image_name,
|
|
|
|
| 129 |
)
|
| 130 |
|
| 131 |
# run notebook
|
|
|
|
| 132 |
print(self.run(notebook_path))
|
| 133 |
|
| 134 |
number_of_checks = 0
|
app.py
CHANGED
|
@@ -34,7 +34,7 @@ def generate_button_clicked(input_image: Image = None, edit_instruction: str = "
|
|
| 34 |
status, img = api_connection.generate_image(
|
| 35 |
input_image_name, edit_instruction, output_image_name
|
| 36 |
)
|
| 37 |
-
|
| 38 |
if status == False:
|
| 39 |
raise gr.Error(img) # img represents the error
|
| 40 |
|
|
|
|
| 34 |
status, img = api_connection.generate_image(
|
| 35 |
input_image_name, edit_instruction, output_image_name
|
| 36 |
)
|
| 37 |
+
print(rf"Finish Time : {api_connection.get_current_time()}")
|
| 38 |
if status == False:
|
| 39 |
raise gr.Error(img) # img represents the error
|
| 40 |
|