to make sure of image generation observability : add an explicit flush right before the script ends

#3
.github/workflows/deploy-modal.yml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy Modal Services
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - 'vllm_inference.py'
8
+ - 'voxcpm_generator.py'
9
+ - 'transcribe_generator.py'
10
+ pull_request:
11
+ branches: [main]
12
+ paths:
13
+ - 'vllm_inference.py'
14
+ - 'voxcpm_generator.py'
15
+ - 'transcribe_generator.py'
16
+ workflow_dispatch:
17
+
18
+ jobs:
19
+ deploy:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: '3.12'
28
+
29
+ - name: Install Modal CLI
30
+ run: pip install modal
31
+
32
+ - name: Deploy vLLM Inference
33
+ run: modal deploy vllm_inference.py
34
+ env:
35
+ MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
36
+ MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
37
+
38
+ - name: Deploy VoxCPM Generator
39
+ run: modal deploy voxcpm_generator.py
40
+ env:
41
+ MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
42
+ MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
43
+
44
+ - name: Deploy Transcribe Generator
45
+ run: modal deploy transcribe_generator.py
46
+ env:
47
+ MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
48
+ MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
.github/workflows/deploy-spaces.yml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy to Hugging Face Spaces
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - 'app.py'
8
+ - 'crew2.py'
9
+ - 'requirements.txt'
10
+ - 'README.md'
11
+ - 'config/**'
12
+ - 'skills/**'
13
+ workflow_dispatch:
14
+
15
+ jobs:
16
+ deploy:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Push to HF Spaces
24
+ env:
25
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
26
+ run: |
27
+ git remote add spaces https://RCaz:${HF_TOKEN}@huggingface.co/spaces/RCaz/Build_small_hackathon_Thousand_tokens_world
28
+ git push spaces main:main --force
crew2.py CHANGED
@@ -55,6 +55,7 @@ try:
55
  tracer = trace.get_tracer("crewai")
56
  except ImportError:
57
  tracer = None
 
58
 
59
 
60
  ###### The agentic app
@@ -541,3 +542,10 @@ if __name__ == "__main__":
541
  )
542
  else:
543
  print("\n(Skipping voice generation — no caption/style found)")
 
 
 
 
 
 
 
 
55
  tracer = trace.get_tracer("crewai")
56
  except ImportError:
57
  tracer = None
58
+ tracer_provider = None
59
 
60
 
61
  ###### The agentic app
 
542
  )
543
  else:
544
  print("\n(Skipping voice generation — no caption/style found)")
545
+
546
+ # ------ Flush OpenTelemetry spans before exit ------
547
+ if tracer_provider is not None and hasattr(tracer_provider, "force_flush"):
548
+ try:
549
+ tracer_provider.force_flush()
550
+ except Exception:
551
+ pass