Run this model with HF Jobs
Run IFM/CrystalChat-7B-Web2Code on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/IFM/CrystalChat-7B-Web2Code. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/IFM/CrystalChat-7B-Web2Code on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/IFM/CrystalChat-7B-Web2Code. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/IFM/CrystalChat-7B-Web2Code. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use IFM/CrystalChat-7B-Web2Code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IFM/CrystalChat-7B-Web2Code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IFM/CrystalChat-7B-Web2Code", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("IFM/CrystalChat-7B-Web2Code", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IFM/CrystalChat-7B-Web2Code with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IFM/CrystalChat-7B-Web2Code" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/CrystalChat-7B-Web2Code", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/IFM/CrystalChat-7B-Web2Code
- SGLang
How to use IFM/CrystalChat-7B-Web2Code with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "IFM/CrystalChat-7B-Web2Code" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/CrystalChat-7B-Web2Code", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "IFM/CrystalChat-7B-Web2Code" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/CrystalChat-7B-Web2Code", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use IFM/CrystalChat-7B-Web2Code with Docker Model Runner:
docker model run hf.co/IFM/CrystalChat-7B-Web2Code
Update README.md
Browse files30 unmodified lines31323334353611 unmodified lines48495051525354555657585960616263646566676869707130 unmodified lines## Evaluations## Webpage Code Generation Benchmark (WCGB)Utilizing the same images as the WUB, this benchmark evaluates a multimodal model tasked with generating HTML code from webpage images based on specific instructions. Unlike traditionalcode-level evaluations, this benchmark assesses the generated webpageβs fidelity at the image level. We convert the predicted HTML codes back into images using Selenium WebDriver to allow a direct visual comparison with the ground truth images. The evaluation, depicted on the left side of Figure 6, considers 10 different aspects, which are further categorized into four evaluation matrices using the GPT-4 Vision API.11 unmodified lines| | β | β | β | β | **7.876** | **7.687** | **7.267** | **7.563** | **7.598** || **Llama3-8B** | β | β | β | β | **8.522** | **8.564** | **8.421** | **8.611** | **8.530** |**Table 1:** The performance of different LLM backbones under various data configurations on our Webpage Code Generation Benchmark (WCGB). "VSA" denotes Visual Structure and Alignment, "CAD" represents Color and Aesthetic Design, "TCC" represents Textual and Content Consistency, and "UII" denotes User Interface and Interactivity.## Webpage Understanding Benchmark (WUB)### Results| LLM Backbone | DWCG | DWU | DWCG<sub>R</sub> | DWU<sub>R</sub> | Accuracy (%) ||------------------------|------|-----|------------------|------------------|--------------|| **CrystalChat-7B** | | | | | 73.94 || | β | β | | | 73.48 || | β | β | β | β | **74.14** || **Vicuna-7B** | | | | | 71.12 || | β | | | | 68.11 || | | β | | | 70.82 || | β | β | β | β | **71.23** || **Llama3-8B** | β | β | β | β | **74.84** |**Table 2:** The accuracy of webpage understanding under various data configurations and LLM backbones.All models are instruction-tuned and evaluated on our WUB benchmark. We note that the general domain data (i.e., LLaVA) is included in all data configuration as default.### About CrystalChat-7B-Web2Code:* 7 billion parameter LLM30 unmodified lines3132333435363738394041424344454647484950515211 unmodified lines6465666768697030 unmodified lines## Evaluations## Webpage Understanding Benchmark (WUB)### Results| LLM Backbone | DWCG | DWU | DWCG<sub>R</sub> | DWU<sub>R</sub> | Accuracy (%) ||------------------------|------|-----|------------------|------------------|--------------|| **CrystalChat-7B** | | | | | 73.94 || | β | β | | | 73.48 || | β | β | β | β | **74.14** || **Vicuna-7B** | | | | | 71.12 || | β | | | | 68.11 || | | β | | | 70.82 || | β | β | β | β | **71.23** || **Llama3-8B** | β | β | β | β | **74.84** |**Table 1:** The accuracy of webpage understanding under various data configurations and LLM backbones.All models are instruction-tuned and evaluated on our WUB benchmark. We note that the general domain data (i.e., LLaVA) is included in all data configuration as default.## Webpage Code Generation Benchmark (WCGB)Utilizing the same images as the WUB, this benchmark evaluates a multimodal model tasked with generating HTML code from webpage images based on specific instructions. Unlike traditionalcode-level evaluations, this benchmark assesses the generated webpageβs fidelity at the image level. We convert the predicted HTML codes back into images using Selenium WebDriver to allow a direct visual comparison with the ground truth images. The evaluation, depicted on the left side of Figure 6, considers 10 different aspects, which are further categorized into four evaluation matrices using the GPT-4 Vision API.11 unmodified lines| | β | β | β | β | **7.876** | **7.687** | **7.267** | **7.563** | **7.598** || **Llama3-8B** | β | β | β | β | **8.522** | **8.564** | **8.421** | **8.611** | **8.530** |**Table 2:** The performance of different LLM backbones under various data configurations on our Webpage Code Generation Benchmark (WCGB). "VSA" denotes Visual Structure and Alignment, "CAD" represents Color and Aesthetic Design, "TCC" represents Textual and Content Consistency, and "UII" denotes User Interface and Interactivity.### About CrystalChat-7B-Web2Code:* 7 billion parameter LLM
README.md+17-18