huseinzol05 commited on
Commit
702a59c
1 Parent(s): 1327057

Upload 2 files

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. wapcar-chat.json +3 -0
  3. wapcar-multiturn.ipynb +142 -0
.gitattributes CHANGED
@@ -54,3 +54,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
56
  car-data.jsonl filter=lfs diff=lfs merge=lfs -text
 
 
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
56
  car-data.jsonl filter=lfs diff=lfs merge=lfs -text
57
+ wapcar-chat.json filter=lfs diff=lfs merge=lfs -text
wapcar-chat.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf971dd733cb21e7697d0de58b72aac5c6b8b0408d43a262fe68751638a597be
3
+ size 202267813
wapcar-multiturn.ipynb ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "038bc3c5",
7
+ "metadata": {},
8
+ "outputs": [
9
+ {
10
+ "name": "stdout",
11
+ "output_type": "stream",
12
+ "text": [
13
+ "--2024-01-24 11:38:58-- https://huggingface.co/datasets/malaysia-ai/wapcar.my-multiturn/resolve/main/car-data.jsonl\n",
14
+ "Resolving huggingface.co (huggingface.co)... 18.67.181.100, 18.67.181.124, 18.67.181.126, ...\n",
15
+ "Connecting to huggingface.co (huggingface.co)|18.67.181.100|:443... connected.\n",
16
+ "HTTP request sent, awaiting response... 302 Found\n",
17
+ "Location: https://cdn-lfs-us-1.huggingface.co/repos/07/d1/07d149676aba72bd90f1000b4e614862bc90bbc57dd87efe07fd394dde768338/b3aebea7f9602157aeb5059acc66240079b02141ea5a39cf1ceb2ece25fa8a85?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27car-data.jsonl%3B+filename%3D%22car-data.jsonl%22%3B&Expires=1706326739&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcwNjMyNjczOX19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy11cy0xLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzA3L2QxLzA3ZDE0OTY3NmFiYTcyYmQ5MGYxMDAwYjRlNjE0ODYyYmM5MGJiYzU3ZGQ4N2VmZTA3ZmQzOTRkZGU3NjgzMzgvYjNhZWJlYTdmOTYwMjE1N2FlYjUwNTlhY2M2NjI0MDA3OWIwMjE0MWVhNWEzOWNmMWNlYjJlY2UyNWZhOGE4NT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoifV19&Signature=buN8EGWarhSh0LXreNIvGRqlHZbRaxvH0INuQ-v7eOMq%7Evm0Uz7w9C4fg5A7lOjeJAQJ%7E6%7EzPnOC-aNyEiOW1xpWPbfH6C0cTkn5v4T4cS7YABtaSVWmGAC-DIGRxMgmpDoSXXoz7F-9sct4cDASa676H09LIMmZuExkbg9LLbQPJscewXExPoOhlZFo%7EvzA3LzBE-0GneewvdZJXeVuOwb%7EY4J0Jd9ObOJaJI5aP-ObpVhurwR9OrSQ0U51AdJxAS5oq-j49wnMFey-3uGFZa06Pf57W6mEAE3Lk6Jogqec1H7FAScZZBnVrmyidQSZ6r%7E-an7XNF-xatr2ncdrtQ__&Key-Pair-Id=KCD77M1F0VK2B [following]\n",
18
+ "--2024-01-24 11:38:59-- https://cdn-lfs-us-1.huggingface.co/repos/07/d1/07d149676aba72bd90f1000b4e614862bc90bbc57dd87efe07fd394dde768338/b3aebea7f9602157aeb5059acc66240079b02141ea5a39cf1ceb2ece25fa8a85?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27car-data.jsonl%3B+filename%3D%22car-data.jsonl%22%3B&Expires=1706326739&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcwNjMyNjczOX19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy11cy0xLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzA3L2QxLzA3ZDE0OTY3NmFiYTcyYmQ5MGYxMDAwYjRlNjE0ODYyYmM5MGJiYzU3ZGQ4N2VmZTA3ZmQzOTRkZGU3NjgzMzgvYjNhZWJlYTdmOTYwMjE1N2FlYjUwNTlhY2M2NjI0MDA3OWIwMjE0MWVhNWEzOWNmMWNlYjJlY2UyNWZhOGE4NT9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSoifV19&Signature=buN8EGWarhSh0LXreNIvGRqlHZbRaxvH0INuQ-v7eOMq%7Evm0Uz7w9C4fg5A7lOjeJAQJ%7E6%7EzPnOC-aNyEiOW1xpWPbfH6C0cTkn5v4T4cS7YABtaSVWmGAC-DIGRxMgmpDoSXXoz7F-9sct4cDASa676H09LIMmZuExkbg9LLbQPJscewXExPoOhlZFo%7EvzA3LzBE-0GneewvdZJXeVuOwb%7EY4J0Jd9ObOJaJI5aP-ObpVhurwR9OrSQ0U51AdJxAS5oq-j49wnMFey-3uGFZa06Pf57W6mEAE3Lk6Jogqec1H7FAScZZBnVrmyidQSZ6r%7E-an7XNF-xatr2ncdrtQ__&Key-Pair-Id=KCD77M1F0VK2B\n",
19
+ "Resolving cdn-lfs-us-1.huggingface.co (cdn-lfs-us-1.huggingface.co)... 18.161.180.103, 18.161.180.118, 18.161.180.25, ...\n",
20
+ "Connecting to cdn-lfs-us-1.huggingface.co (cdn-lfs-us-1.huggingface.co)|18.161.180.103|:443... connected.\n",
21
+ "HTTP request sent, awaiting response... 200 OK\n",
22
+ "Length: 199822581 (191M) [binary/octet-stream]\n",
23
+ "Saving to: ‘car-data.jsonl’\n",
24
+ "\n",
25
+ "car-data.jsonl 100%[===================>] 190.57M 20.2MB/s in 9.7s \n",
26
+ "\n",
27
+ "2024-01-24 11:39:09 (19.7 MB/s) - ‘car-data.jsonl’ saved [199822581/199822581]\n",
28
+ "\n"
29
+ ]
30
+ }
31
+ ],
32
+ "source": [
33
+ "!wget https://huggingface.co/datasets/malaysia-ai/wapcar.my-multiturn/resolve/main/car-data.jsonl"
34
+ ]
35
+ },
36
+ {
37
+ "cell_type": "code",
38
+ "execution_count": 7,
39
+ "id": "efe6cb33",
40
+ "metadata": {},
41
+ "outputs": [
42
+ {
43
+ "data": {
44
+ "text/plain": [
45
+ "51136"
46
+ ]
47
+ },
48
+ "execution_count": 7,
49
+ "metadata": {},
50
+ "output_type": "execute_result"
51
+ }
52
+ ],
53
+ "source": [
54
+ "import json\n",
55
+ "\n",
56
+ "data = []\n",
57
+ "with open('car-data.jsonl') as fopen:\n",
58
+ " for l in fopen:\n",
59
+ " l = json.loads(l)\n",
60
+ " data.append(l)\n",
61
+ "len(data)"
62
+ ]
63
+ },
64
+ {
65
+ "cell_type": "code",
66
+ "execution_count": 18,
67
+ "id": "586f62bf",
68
+ "metadata": {},
69
+ "outputs": [],
70
+ "source": [
71
+ "chats = []\n",
72
+ "for d in data:\n",
73
+ " name = d['specs'][0].split(':')[1].strip()\n",
74
+ " specs = [r.strip() for r in d['specs'][1:]]\n",
75
+ " conversations = [\n",
76
+ " {\"role\": \"user\", \"content\": \"<image>Ini model apa?\"},\n",
77
+ " {\"role\": \"assistant\", \"content\": name},\n",
78
+ " {\"role\": \"user\", \"content\": \"apa spesifikasi kereta tu?\"},\n",
79
+ " {\"role\": \"assistant\", \"content\": specs},\n",
80
+ " ]\n",
81
+ " chats.append({\n",
82
+ " 'image': d['local_image'],\n",
83
+ " 'image_url': d['img_url'],\n",
84
+ " 'conversations': conversations\n",
85
+ " })"
86
+ ]
87
+ },
88
+ {
89
+ "cell_type": "code",
90
+ "execution_count": 19,
91
+ "id": "7602a37a",
92
+ "metadata": {},
93
+ "outputs": [
94
+ {
95
+ "data": {
96
+ "text/plain": [
97
+ "51136"
98
+ ]
99
+ },
100
+ "execution_count": 19,
101
+ "metadata": {},
102
+ "output_type": "execute_result"
103
+ }
104
+ ],
105
+ "source": [
106
+ "len(chats)"
107
+ ]
108
+ },
109
+ {
110
+ "cell_type": "code",
111
+ "execution_count": 22,
112
+ "id": "d47f3bcc",
113
+ "metadata": {},
114
+ "outputs": [],
115
+ "source": [
116
+ "with open('wapcar-chat.json', 'w') as fopen:\n",
117
+ " json.dump(chats, fopen)"
118
+ ]
119
+ }
120
+ ],
121
+ "metadata": {
122
+ "kernelspec": {
123
+ "display_name": "Python 3 (ipykernel)",
124
+ "language": "python",
125
+ "name": "python3"
126
+ },
127
+ "language_info": {
128
+ "codemirror_mode": {
129
+ "name": "ipython",
130
+ "version": 3
131
+ },
132
+ "file_extension": ".py",
133
+ "mimetype": "text/x-python",
134
+ "name": "python",
135
+ "nbconvert_exporter": "python",
136
+ "pygments_lexer": "ipython3",
137
+ "version": "3.8.10"
138
+ }
139
+ },
140
+ "nbformat": 4,
141
+ "nbformat_minor": 5
142
+ }