Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,26 @@ from transformers import pipeline
|
|
2 |
asr_pipe = pipeline("automatic-speech-recognition", model="Abdullah17/whisper-small-urdu")
|
3 |
from difflib import SequenceMatcher
|
4 |
import json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
with open("tasks.json", "r",encoding="utf-8") as json_file:
|
6 |
urdu_data = json.load(json_file)
|
7 |
# List of commands
|
|
|
2 |
asr_pipe = pipeline("automatic-speech-recognition", model="Abdullah17/whisper-small-urdu")
|
3 |
from difflib import SequenceMatcher
|
4 |
import json
|
5 |
+
import socket
|
6 |
+
|
7 |
+
def get_local_ip():
|
8 |
+
try:
|
9 |
+
# Create a socket connection to a remote host (here, google.com)
|
10 |
+
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
11 |
+
s.connect(("8.8.8.8", 80))
|
12 |
+
local_ip = s.getsockname()[0]
|
13 |
+
s.close()
|
14 |
+
return local_ip
|
15 |
+
except Exception as e:
|
16 |
+
print(f"Error getting local IP: {e}")
|
17 |
+
return None
|
18 |
+
|
19 |
+
local_ip = get_local_ip()
|
20 |
+
if local_ip:
|
21 |
+
print(f"Local IP Address: {local_ip}")
|
22 |
+
else:
|
23 |
+
print("Local IP could not be determined.")
|
24 |
+
|
25 |
with open("tasks.json", "r",encoding="utf-8") as json_file:
|
26 |
urdu_data = json.load(json_file)
|
27 |
# List of commands
|