Anna Sun commited on
Commit
d9b3f79
1 Parent(s): 1143e8d

handle missing credentials

Browse files
Dockerfile CHANGED
@@ -71,14 +71,15 @@ RUN cd seamless_server && \
71
  COPY --from=frontend /app/dist ./streaming-react-app/dist
72
 
73
  WORKDIR $HOME/app/seamless_server
74
- RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
75
- huggingface-cli login --token $(cat /run/secrets/HF_TOKEN) && \
76
- huggingface-cli download meta-private/SeamlessExpressive pretssel_melhifigan_wm-final.pt --local-dir ./models/Seamless/ && \
77
- ln -s $(readlink -f models/Seamless/pretssel_melhifigan_wm-final.pt) models/Seamless/pretssel_melhifigan_wm.pt
78
 
79
  USER root
80
  RUN ln -s /usr/lib/x86_64-linux-gnu/libsox.so.3 /usr/lib/x86_64-linux-gnu/libsox.so
81
  USER user
82
- CMD [ "uvicorn", "app_pubsub:app", "--host", "0.0.0.0", "--port", "7860" ]
 
83
 
84
 
 
71
  COPY --from=frontend /app/dist ./streaming-react-app/dist
72
 
73
  WORKDIR $HOME/app/seamless_server
74
+ RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=false \
75
+ huggingface-cli login --token $(cat /run/secrets/HF_TOKEN) || echo "HF_TOKEN error" && \
76
+ huggingface-cli download meta-private/SeamlessExpressive pretssel_melhifigan_wm-final.pt --local-dir ./models/Seamless/ || echo "HF_TOKEN error" && \
77
+ ln -s $(readlink -f models/Seamless/pretssel_melhifigan_wm-final.pt) models/Seamless/pretssel_melhifigan_wm.pt || true;
78
 
79
  USER root
80
  RUN ln -s /usr/lib/x86_64-linux-gnu/libsox.so.3 /usr/lib/x86_64-linux-gnu/libsox.so
81
  USER user
82
+ RUN ["chmod", "+x", "./run_docker.sh"]
83
+ CMD ./run_docker.sh
84
 
85
 
seamless_server/app_pubsub.py CHANGED
@@ -124,7 +124,7 @@ class ServerLock(TypedDict):
124
  member_object: Member
125
 
126
 
127
- if os.environ.get("LOCK_SERVER_COMPLETELY"):
128
  logger.info("LOCK_SERVER_COMPLETELY is set. Server will be locked on startup.")
129
  dummy_server_lock_member_object = Member(
130
  client_id="seamless_user", session_id="dummy", name="Seamless User"
@@ -137,7 +137,7 @@ server_lock: Optional[ServerLock] = (
137
  "client_id": "seamless_user",
138
  "member_object": dummy_server_lock_member_object,
139
  }
140
- if os.environ.get("LOCK_SERVER_COMPLETELY")
141
  else None
142
  )
143
 
@@ -517,7 +517,7 @@ async def join_room(sid, client_id, room_id_from_client, config_dict):
517
  and config_dict.get("lockServerName")
518
  == ESCAPE_HATCH_SERVER_LOCK_RELEASE_NAME
519
  # If we are locking the server completely we don't want someone to be able to unlock it
520
- and not os.environ.get("LOCK_SERVER_COMPLETELY")
521
  ):
522
  server_lock = None
523
  logger.info(
 
124
  member_object: Member
125
 
126
 
127
+ if os.environ.get("LOCK_SERVER_COMPLETELY", "0") == "1":
128
  logger.info("LOCK_SERVER_COMPLETELY is set. Server will be locked on startup.")
129
  dummy_server_lock_member_object = Member(
130
  client_id="seamless_user", session_id="dummy", name="Seamless User"
 
137
  "client_id": "seamless_user",
138
  "member_object": dummy_server_lock_member_object,
139
  }
140
+ if os.environ.get("LOCK_SERVER_COMPLETELY", "0") == "1"
141
  else None
142
  )
143
 
 
517
  and config_dict.get("lockServerName")
518
  == ESCAPE_HATCH_SERVER_LOCK_RELEASE_NAME
519
  # If we are locking the server completely we don't want someone to be able to unlock it
520
+ and not os.environ.get("LOCK_SERVER_COMPLETELY", "0") == "1"
521
  ):
522
  server_lock = None
523
  logger.info(
seamless_server/run_docker.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # !/bin/bash
2
+ if [ -f models/Seamless/pretssel_melhifigan_wm.pt ] ; then
3
+ export USE_EXPRESSIVE_MODEL=1;
4
+ fi
5
+ uvicorn app_pubsub:app --host 0.0.0.0 --port 7860
seamless_server/src/simuleval_agent_directory.py CHANGED
@@ -120,7 +120,7 @@ class SimulevalAgentDirectory:
120
  self.add_agent(agent_info)
121
  else:
122
  s2s_agent = None
123
- if os.environ.get("USE_EXPRESSIVE_MODEL"):
124
  logger.info("Building expressive model...")
125
  s2s_agent = self.build_agent_if_available(
126
  SimulevalAgentDirectory.seamless_agent,
 
120
  self.add_agent(agent_info)
121
  else:
122
  s2s_agent = None
123
+ if os.environ.get("USE_EXPRESSIVE_MODEL", "0") == "1":
124
  logger.info("Building expressive model...")
125
  s2s_agent = self.build_agent_if_available(
126
  SimulevalAgentDirectory.seamless_agent,