Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@ import os
|
|
| 2 |
import subprocess
|
| 3 |
import random
|
| 4 |
import json
|
|
|
|
| 5 |
from datetime import datetime
|
| 6 |
|
| 7 |
from huggingface_hub import InferenceClient, cached_download, hf_hub_url
|
|
@@ -242,11 +243,27 @@ def run(self):
|
|
| 242 |
except KeyboardInterrupt:
|
| 243 |
print("\nApplication stopped by user.")
|
| 244 |
|
| 245 |
-
def
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
|
| 251 |
-
|
| 252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import subprocess
|
| 3 |
import random
|
| 4 |
import json
|
| 5 |
+
import tkinter as tk
|
| 6 |
from datetime import datetime
|
| 7 |
|
| 8 |
from huggingface_hub import InferenceClient, cached_download, hf_hub_url
|
|
|
|
| 243 |
except KeyboardInterrupt:
|
| 244 |
print("\nApplication stopped by user.")
|
| 245 |
|
| 246 |
+
def run(self):
|
| 247 |
+
print("Welcome to the Python App Builder!")
|
| 248 |
+
print("Type 'help' to see the available commands.")
|
| 249 |
+
print("-" * 50)
|
| 250 |
+
try:
|
| 251 |
+
while True:
|
| 252 |
+
try:
|
| 253 |
+
input_text = input("Enter input: ")
|
| 254 |
+
except EOFError:
|
| 255 |
+
print("Error: Input reading interrupted. Please provide valid input.")
|
| 256 |
+
continue
|
| 257 |
|
| 258 |
+
output, system_message = self.process_input(input_text)
|
| 259 |
+
if output:
|
| 260 |
+
print(output)
|
| 261 |
+
if system_message:
|
| 262 |
+
print(system_message)
|
| 263 |
+
except KeyboardInterrupt:
|
| 264 |
+
print("\nApplication stopped by user.")
|
| 265 |
+
|
| 266 |
+
def main():
|
| 267 |
+
app = App()
|
| 268 |
+
print(f"===== Application Startup at {datetime.now().strftime('%Y-%m-%d %H:%M:%S')} =====")
|
| 269 |
+
app.run()
|