Spaces:
Paused
Paused
Commit
·
dc8d027
1
Parent(s):
65ee86e
oh yeah.
Browse files- src/app/main.tsx +5 -2
- src/app/observer.tsx +5 -5
src/app/main.tsx
CHANGED
@@ -95,8 +95,11 @@ export default function Main() {
|
|
95 |
|
96 |
<div className="fixed z-10 left-0 right-0 bottom-0 flex flex-col items-center justify-center">
|
97 |
<div className="full md:w-[80%] lg:w-[70%] mb-0 md:p-4 md:mb-8 bg-zinc-100 md:rounded-xl p-4 shadow-2xl text-xs md:text-sm">
|
98 |
-
<p>🅿️ <span className="font-semibold">Informations: </span> This demo uses
|
99 |
-
|
|
|
|
|
|
|
100 |
</div>
|
101 |
</div>
|
102 |
</div>
|
|
|
95 |
|
96 |
<div className="fixed z-10 left-0 right-0 bottom-0 flex flex-col items-center justify-center">
|
97 |
<div className="full md:w-[80%] lg:w-[70%] mb-0 md:p-4 md:mb-8 bg-zinc-100 md:rounded-xl p-4 shadow-2xl text-xs md:text-sm">
|
98 |
+
<p>🅿️ <span className="font-semibold">Informations: </span> This demo uses
|
99 |
+
<a href="https://huggingface.co/HuggingFaceM4/idefics-80b#bias-evaluation" target="_blank" className="font-semibold"> IDEFICS </a>
|
100 |
+
and
|
101 |
+
<a href="https://huggingface.co/meta-llama" target="_blank" className="font-semibold"> Llama-2 </a>, and is provided for demonstration and research purposes.</p>
|
102 |
+
<p>⛔️ <span className="font-semibold">Limitations: </span> This demo is provided as-is, with no guarantee of factually correct results. In some cases, the models may return hallucinated or innapropriate responses.</p>
|
103 |
</div>
|
104 |
</div>
|
105 |
</div>
|
src/app/observer.tsx
CHANGED
@@ -66,7 +66,7 @@ export default function Observer({
|
|
66 |
|
67 |
setBusy(true)
|
68 |
|
69 |
-
console.log("Capturing new frame..")
|
70 |
|
71 |
startTransition(async () => {
|
72 |
const imageBase64 = capture()
|
@@ -81,21 +81,21 @@ export default function Observer({
|
|
81 |
const prompt = `What do you see here?`
|
82 |
|
83 |
console.log("Calling IDEFICS..")
|
84 |
-
const newObservation =
|
85 |
|
86 |
console.log("New observation: ", newObservation)
|
87 |
if (newObservation !== lastObservation) {
|
88 |
-
console.log("update!")
|
89 |
setLastObservation(newObservation || "")
|
90 |
onObserve(newObservation || "", imageBase64)
|
91 |
}
|
92 |
setLastObservedAt(Date.now())
|
93 |
|
94 |
-
//
|
95 |
setBusy(false)
|
96 |
})
|
97 |
|
98 |
-
console.log("observation ended!")
|
99 |
}
|
100 |
|
101 |
useInterval(() => {
|
|
|
66 |
|
67 |
setBusy(true)
|
68 |
|
69 |
+
console.log("Capturing new frame from webcam..")
|
70 |
|
71 |
startTransition(async () => {
|
72 |
const imageBase64 = capture()
|
|
|
81 |
const prompt = `What do you see here?`
|
82 |
|
83 |
console.log("Calling IDEFICS..")
|
84 |
+
const newObservation = await see({ prompt, imageBase64 })
|
85 |
|
86 |
console.log("New observation: ", newObservation)
|
87 |
if (newObservation !== lastObservation) {
|
88 |
+
// console.log("update!")
|
89 |
setLastObservation(newObservation || "")
|
90 |
onObserve(newObservation || "", imageBase64)
|
91 |
}
|
92 |
setLastObservedAt(Date.now())
|
93 |
|
94 |
+
// comment to disable the infinite loop!
|
95 |
setBusy(false)
|
96 |
})
|
97 |
|
98 |
+
// console.log("observation ended!")
|
99 |
}
|
100 |
|
101 |
useInterval(() => {
|