Spaces:
Running
Running
File size: 1,640 Bytes
53061be bc6c8eb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
---
title: Newpress Ai
emoji: π
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 6.0.1
app_file: app.py
pinned: false
short_description: An AI for Newpress
---
# NewPress AI - Johnny Harris Script Assistant
Use Johnny's archive of hundreds of video transcripts to:
- **Search** if a topic has been covered before
- **Generate** scripts in Johnny's voice from your notes
## Dependency Notes
### Gradio + Supabase Compatibility
There's a dependency conflict between older Gradio versions and Supabase:
- **supabase >= 2.0** requires `realtime` which needs `websockets >= 13.0`
- **gradio 4.x** pins `websockets` to 12.x via `gradio_client`
- **gradio >= 5.0** supports `websockets >= 13.0`
**Solution**: Use `gradio >= 5.0.0` in requirements.txt
### Gradio 6.x API Changes
In Gradio 6.0, the `theme` parameter moved from `gr.Blocks()` to `.launch()`:
```python
# Old (Gradio 4.x)
with gr.Blocks(theme=gr.themes.Soft()) as app:
...
# New (Gradio 6.x)
with gr.Blocks() as app:
...
app.launch(theme="soft")
```
### Progress Indicators
For progress bars and spinners to work in Gradio, functions must be **generators** that `yield` intermediate results:
```python
# Won't show progress (regular function)
def search(query, progress=gr.Progress()):
progress(0.5, desc="Searching...")
return results # No UI updates until complete
# Will show progress (generator)
def search(query, progress=gr.Progress()):
progress(0.5, desc="Searching...")
yield "Searching..." # UI updates here
yield results # Final result
```
The `yield` statements create checkpoints where Gradio can update the UI.
|