3 ms·
My current test of image models is generating React code from a screenshot of the top of a HackerNews comment page. Llava-1.6 gave me this (over two responses),
by sestinj 3y ago
My current test of image models is generating React code from a screenshot of the top of a HackerNews comment page. Llava-1.6 gave me this (over two responses), which is honestly not bad:
```ts
const CommentForm = () => {
// State to hold the user's input
const [comment, setComment] = useState('');
// State to hold the list of comments
const [comments, setComments] = useState([]);
// Function for posting a new comment
const postComment = (e) => {
e.preventDefault();
// Add logic here to handle the POST request and update state
setComments([...comments, { content: comment }]); // Assuming you want the entire object in your state
setComment(''); // Reset the input field after posting
};
...
```
```ts
import React from 'react';
import { CommentForm } from './CommentForm';
const App = () => {
return (
<div>
<h1>Comments</h1>
<CommentForm />
{comments && <ul>
{comments.map(comment => <li>{comment.content}</li>)}
</ul>}
</div>
);
};
export default App;
```
- thelastparadise 3y agoPerhaps try two stages. Stage 1: Generate detailed description from image w/llava. Stage2: Code the page using miqu 1.