Spaces:
Runtime error
Runtime error
osanseviero
commited on
Commit
•
be42941
1
Parent(s):
e576f9f
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,8 @@ from langchain.chains.conversation.memory import ConversationalBufferWindowMemor
|
|
17 |
|
18 |
MODEL_NAME = "mn40_as"
|
19 |
|
|
|
|
|
20 |
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
21 |
model = get_mobilenet(width_mult=NAME_TO_WIDTH(MODEL_NAME), pretrained_name=MODEL_NAME)
|
22 |
model.to(device)
|
@@ -66,7 +68,8 @@ def format_classname(classname):
|
|
66 |
return classname.capitalize()
|
67 |
|
68 |
def formatted_message(audio_class, human_input):
|
69 |
-
global cached_audio_class
|
|
|
70 |
formatted_classname = format_classname(audio_class)
|
71 |
if cached_audio_class != formatted_classname:
|
72 |
|
|
|
17 |
|
18 |
MODEL_NAME = "mn40_as"
|
19 |
|
20 |
+
session_token = os.environ["SESSION_TOKEN"]
|
21 |
+
|
22 |
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
|
23 |
model = get_mobilenet(width_mult=NAME_TO_WIDTH(MODEL_NAME), pretrained_name=MODEL_NAME)
|
24 |
model.to(device)
|
|
|
68 |
return classname.capitalize()
|
69 |
|
70 |
def formatted_message(audio_class, human_input):
|
71 |
+
global cached_audio_class
|
72 |
+
global session_token
|
73 |
formatted_classname = format_classname(audio_class)
|
74 |
if cached_audio_class != formatted_classname:
|
75 |
|