blairyeung commited on
Commit
bac17d4
1 Parent(s): 72160bd

Moved frm other space to here

Browse files
Files changed (1) hide show
  1. prompt_tune.ipynb +0 -156
prompt_tune.ipynb DELETED
@@ -1,156 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "code",
5
- "execution_count": 7,
6
- "id": "initial_id",
7
- "metadata": {
8
- "collapsed": true,
9
- "ExecuteTime": {
10
- "end_time": "2024-03-03T22:18:17.446935Z",
11
- "start_time": "2024-03-03T22:18:17.444330Z"
12
- }
13
- },
14
- "outputs": [],
15
- "source": [
16
- "from models import select_model\n",
17
- "from app import Card\n",
18
- "\n",
19
- "# model_name = \"mistralai/Mistral-7B-Instruct-v0.2\"\n",
20
- "# model_name = \"mistralai/Mixtral-8x7B-Instruct-v0.1\"\n",
21
- "# model_name = \"meta-llama/Llama-2-70b-chat-hf\"\n",
22
- "model_name = \"NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO\"\n",
23
- "\n",
24
- "system_prompt = \"\"\"\n",
25
- "You are the best summarizer. You can copy text identically. You can effectively extract relevant information from texts and summarize it in a human-readable format without losing information.\n",
26
- "\"\"\"\n",
27
- "\n",
28
- "model = select_model(model_name, system_prompt)"
29
- ]
30
- },
31
- {
32
- "cell_type": "code",
33
- "outputs": [],
34
- "source": [
35
- "user_prompt = \"\"\"\n",
36
- "# Your Task\n",
37
- "\n",
38
- "1. Copy relevant parts in the student's evaluation based on the given question.\n",
39
- "2. After the copy, summarize the copied text in a human-readable format without losing information.\n",
40
- "\n",
41
- "# The Student's Evaluation\n",
42
- "\n",
43
- "{card}\n",
44
- "\n",
45
- "# The Question\n",
46
- "\n",
47
- "{qa}\n",
48
- "\n",
49
- "# Your Summary\n",
50
- "\n",
51
- "You should follow a markdown format with two headings: \"Copies of Relevant Parts\" and \"Summary\".\n",
52
- "\n",
53
- "IMPORTANT Requirements: \n",
54
- "- Don't answer the question, but rather extract parts from the student's evaluation that are relevant to the question.\n",
55
- "- Maintain a neutral frame. Do not include your own opinion or judgment. Include both strengths and weakness.\n",
56
- "- The summary should be concise but capture all the relevant information.\n",
57
- "\"\"\"\n",
58
- "\n",
59
- "card = Card(\"dataset/mmlu/cards/high_school_physics/high_school_physics_Mistral-7B-Instruct-v0.2_0.json\")\n",
60
- "\n",
61
- "qa = \"\"\"\n",
62
- "A cannon is mounted on a truck that moves forward at a speed of 5 m/s. The operator wants to launch a ball from a cannon so the ball goes as far as possible before hitting the level surface. The muzzle velocity of the cannon is 50 m/s. At what angle from the horizontal should the operator point the cannon?\n",
63
- "\n",
64
- "A. 5°\n",
65
- "B. 41°\n",
66
- "C. 45°\n",
67
- "D. 49°\n",
68
- "\n",
69
- "Ground Truth: D\n",
70
- "\"\"\"\n",
71
- "\n",
72
- "user_prompt = user_prompt.format(card=str(card), qa=qa)"
73
- ],
74
- "metadata": {
75
- "collapsed": false,
76
- "ExecuteTime": {
77
- "end_time": "2024-03-03T22:18:17.807808Z",
78
- "start_time": "2024-03-03T22:18:17.803354Z"
79
- }
80
- },
81
- "id": "462f7273d0090a8f",
82
- "execution_count": 8
83
- },
84
- {
85
- "cell_type": "code",
86
- "outputs": [
87
- {
88
- "name": "stderr",
89
- "output_type": "stream",
90
- "text": [
91
- "Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"
92
- ]
93
- },
94
- {
95
- "name": "stdout",
96
- "output_type": "stream",
97
- "text": [
98
- "# Copies of Relevant Parts\n",
99
- "\n",
100
- "- Thinking Patterns: It applies conceptual reasoning to motion problems but tends to oversimplify or overcomplicate interactions, leading to incorrect conclusions. It incorrectly correlates net force with acceleration and sometimes includes unnecessary variables in problem-solving.\n",
101
- "- Weakness: There is confusion between gravitational and electric forces, incorrect reasoning about the acceleration of vehicles of different masses, and an assumption that gravitational acceleration remains constant regardless of altitude. Misunderstands the application of Newton's second law in the context of the elevator problem, incorrectly adding height as a necessary variable.\n",
102
- "- Conceptual Reasoning in Physics: The student demonstrates a mixed level of conceptual reasoning across different areas of physics, with strengths in some areas and significant misconceptions in others. Often uses correct reasoning but arrives at incorrect conclusions due to fundamental misunderstandings.\n",
103
- "- Vector Analysis Understanding: The student lacks a fundamental understanding of vector addition and the conditions for vector cancellation and demonstrates a misunderstanding of vector analysis in the context of forces.\n",
104
- "- Problem-Solving Strategy: The student demonstrates a consistent yet inconsistent approach to problem-solving, relying heavily on formulaic solutions but inconsistently applies problem-solving strategies across different physics domains.\n",
105
- "\n",
106
- "# Summary\n",
107
- "\n",
108
- "The student has a mixed understanding of physics concepts, with strengths in some areas and significant misconceptions in others. They tend to oversimplify or overcomplicate interactions, leading to incorrect conclusions. They struggle with the application of conceptual reasoning in electromagnetism, thermodynamics, and frequently misapply or misunderstand fundamental physics concepts. They lack a fundamental understanding of vector addition and the conditions for vector cancellation, and demonstrate a misunderstanding of vector analysis in the context of forces. They also show a consistent yet inconsistent approach to problem-solving, relying heavily on formulaic solutions but inconsistently applying problem-solving strategies across different physics domains.\n"
109
- ]
110
- }
111
- ],
112
- "source": [
113
- "print(model(user_prompt, cache=True))"
114
- ],
115
- "metadata": {
116
- "collapsed": false,
117
- "ExecuteTime": {
118
- "end_time": "2024-03-03T22:18:26.347905Z",
119
- "start_time": "2024-03-03T22:18:18.364713Z"
120
- }
121
- },
122
- "id": "a32382a9201848a9",
123
- "execution_count": 9
124
- },
125
- {
126
- "cell_type": "code",
127
- "outputs": [],
128
- "source": [],
129
- "metadata": {
130
- "collapsed": false
131
- },
132
- "id": "ce12e5f1716b1af4"
133
- }
134
- ],
135
- "metadata": {
136
- "kernelspec": {
137
- "display_name": "Python 3",
138
- "language": "python",
139
- "name": "python3"
140
- },
141
- "language_info": {
142
- "codemirror_mode": {
143
- "name": "ipython",
144
- "version": 2
145
- },
146
- "file_extension": ".py",
147
- "mimetype": "text/x-python",
148
- "name": "python",
149
- "nbconvert_exporter": "python",
150
- "pygments_lexer": "ipython2",
151
- "version": "2.7.6"
152
- }
153
- },
154
- "nbformat": 4,
155
- "nbformat_minor": 5
156
- }