File size: 2,763 Bytes
3e48a1e
 
 
 
 
 
 
 
 
 
 
 
 
 
b2454e0
 
 
 
3e48a1e
b2454e0
 
 
 
 
 
 
3e48a1e
 
 
 
 
 
 
 
 
 
b2454e0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7436a06
 
 
3e48a1e
 
7436a06
3e48a1e
 
 
 
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
65
66
67
68
69
70
71
72
73
74
---
title: Llm Chatbot
emoji: πŸ‘€
colorFrom: indigo
colorTo: red
sdk: gradio
sdk_version: 5.4.0
app_file: app.py
pinned: false
license: apache-2.0
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

# LLM-Based Chat Application

This is a language model-based chat application that provides users with relevant, up-to-date, and easy-to-understand responses by leveraging web search and a powerful language model. The basic flow involves performing a web search using DuckDuckGo, followed by generating a response using the Qwen2.5-0.5b-Instruct language model.

Live project: 
## Features

- **Web Search**: Performs real-time searches using DuckDuckGo to retrieve the latest relevant information.
- **Language Model Integration**: Uses the `qwen2.5-0.5b-instruct` model for generating accurate and coherent responses.
- **Simple Interface**: Built with Gradio to offer an easy-to-use web interface for users to interact with the model.
- **Efficient and Scalable**: Optimized for performance using Intel-specific optimizations via `optimum-intel` and other acceleration libraries.

## Model Used
- Language Model: qwen2.5-0.5b-instruct
- A powerful and efficient model that generates human-like responses based on the query.

## Application Flow
- **User Query**: The user inputs a question or request.
- **Web Search**: The system performs a web search using DuckDuckGo to gather recent and relevant information.
- **Response Generation**: The gathered data is used to generate a clear, relevant, and easy-to-understand response using the qwen2.5-0.5b-instruct language model.
- **User Response**: The application returns the generated response to the user.

## Dependencies

The following dependencies are required for running this application:

- `openvino>=2024.2.0`
- `openvino-tokenizers[transformers]`
- `torch>=2.1`
- `datasets`
- `duckduckgo-search`
- `langchain-community`
- `accelerate`
- `gradio>=4.19`
- `onnx<=1.16.1` (For Windows platform `sys_platform=='win32'`)
- `einops`
- `transformers>=4.43.1`
- `transformers_stream_generator`
- `tiktoken`
- `bitsandbytes`
- `optimum-intel` (installed via `git+https://github.com/huggingface/optimum-intel.git`)
- `nncf` (installed via `git+https://github.com/openvinotoolkit/nncf.git`)

## Installation

To install the required dependencies, you can use the following command:

```bash
pip install -r requirements.txt
```


## License
- This project is licensed under the Apache License 2.0. See the LICENSE file for details.

## Acknowledgements
- **OpenVINO**: For efficient acceleration of the language model.
- **DuckDuckGo**: For providing real-time web search capabilities.
- **Hugging Face**: For providing powerful transformer models and tools.