-
Notifications
You must be signed in to change notification settings - Fork 202
Update to add multi-modal #1522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove failing on pipe errors, since something the network can fail and break the demo, it would be better to continue after failures. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Reviewer's GuideThis PR enhances the demo by relaxing strict pipe error handling and embedding a new multi-modal demonstration: it defines a Bash step to serve a vision-capable model, launches a camera-driven web app for image+instruction interaction, and cleans up after the run. Sequence Diagram for Multi-modal Demo Script ExecutionsequenceDiagram
actor User
participant Script as "ramalama.sh (multi-modal function)"
participant ModelService as "ramalama serve smolvlm"
participant Browser as "Web Browser (camera-demo.html)"
participant StopService as "ramalama stop multi-modal"
User->>Script: Executes multi-modal function
Script->>ModelService: Starts smolvlm service (ramalama serve)
Script->>Browser: Opens camera-demo.html (google-chrome)
Note over Browser, User: User interacts with web app
Script->>User: Waits for 'clear' prompt
User->>Script: Presses Enter
Script->>StopService: Stops smolvlm service (ramalama stop)
Sequence Diagram for Camera Demo Web App InteractionsequenceDiagram
actor User
participant WebApp as "camera-demo.html (Browser)"
participant BrowserAPI as "Browser Camera API"
participant RamaLamaService as "RamaLama API (/v1/chat/completions)"
WebApp->>BrowserAPI: initCamera(): navigator.mediaDevices.getUserMedia()
BrowserAPI-->>WebApp: Camera stream
User->>WebApp: Enters instruction
User->>WebApp: Clicks "Start"
WebApp->>WebApp: handleStart()
loop Image capture and processing interval
WebApp->>WebApp: sendData()
WebApp->>BrowserAPI: captureImage() from video stream
BrowserAPI-->>WebApp: Image (Base64)
WebApp->>RamaLamaService: POST {instruction, image}
RamaLamaService-->>WebApp: {response text}
WebApp->>User: Displays response
end
User->>WebApp: Clicks "Stop"
WebApp->>WebApp: handleStop()
WebApp->>User: Updates UI (e.g., "Processing stopped")
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Replaces #1412 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @rhatdan - I've reviewed your changes - here's some feedback:
- Commenting out
set -eou pipefail
disables strict error handling for the entire demo script—consider scoping error catches around the network calls instead of turning off strict mode globally. - In the HTML demo, the
<input id="baseURL">
tag is incorrectly closed with</textarea>
, breaking the DOM structure—use a proper self-closing<input>
tag. - The JS
sendData
function can fire overlapping requests if one takes longer than the interval—add a per-call in-flight guard or clear the interval until the promise resolves to prevent races.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Commenting out `set -eou pipefail` disables strict error handling for the entire demo script—consider scoping error catches around the network calls instead of turning off strict mode globally.
- In the HTML demo, the `<input id="baseURL">` tag is incorrectly closed with `</textarea>`, breaking the DOM structure—use a proper self-closing `<input>` tag.
- The JS `sendData` function can fire overlapping requests if one takes longer than the interval—add a per-call in-flight guard or clear the interval until the promise resolves to prevent races.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Remove failing on pipe errors, since something the network can fail and break the demo, it would be better to continue after failures.
Summary by Sourcery
Introduce a new multi-modal camera-based demo in the RamaLama demo suite and relax error handling to prevent demo interruptions.
New Features:
Enhancements:
Documentation: