jakewatson91 commited on
Commit
a16e2e3
·
unverified ·
1 Parent(s): ae3a1ea

Update tests.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/tests.yml +72 -72
.github/workflows/tests.yml CHANGED
@@ -1,4 +1,4 @@
1
- name: Testing output
2
 
3
  # on:
4
  # push:
@@ -8,87 +8,87 @@ name: Testing output
8
  # branches:
9
  # - main
10
 
11
- jobs:
12
- build:
13
- runs-on: ubuntu-latest
14
 
15
- steps:
16
- - uses: actions/checkout@v3 # Update to v3
17
- - name: Set up Python
18
- uses: actions/setup-python@v3 # Update to v3
19
- with:
20
- python-version: '3.x'
21
- - name: Install dependencies
22
- run: |
23
- python -m pip install --upgrade pip
24
- pip install gradio huggingface_hub torch transformers accelerate
25
- - name: Run tests
26
- run: |
27
- python -c """
28
- import time
29
- from app import respond, base_message
30
 
31
- def test_api():
32
- message = 'What is the meaning of life?'
33
- history = []
34
- system_message_val = base_message
35
- temperature = 0.7
36
- practicality = 0.8
37
- max_tokens = 256
38
- use_local_model = False # Set to False to use the API-based model
39
 
40
- start_time = time.time()
41
 
42
- result_generator = respond(
43
- message=message,
44
- history=history,
45
- system_message_val=system_message_val,
46
- temperature=temperature,
47
- practicality=practicality,
48
- max_tokens=max_tokens,
49
- use_local_model=use_local_model
50
- )
51
 
52
- for result in result_generator:
53
- final_history, final_system_message = result
54
 
55
- end_time = time.time()
56
- runtime = end_time - start_time
57
 
58
- print('API Runtime: ', runtime)
59
- print('API Final conversation history:', final_history)
60
- print('API Final system message:', final_system_message)
61
 
62
- def test_local():
63
- message = 'What is the meaning of life?'
64
- history = []
65
- system_message_val = base_message
66
- temperature = 0.7
67
- practicality = 0.8
68
- max_tokens = 256
69
- use_local_model = True
70
 
71
- start_time = time.time()
72
 
73
- result = list(respond(
74
- message=message,
75
- history=history,
76
- system_message_val=system_message_val,
77
- temperature=temperature,
78
- practicality=practicality,
79
- max_tokens=max_tokens,
80
- use_local_model=use_local_model
81
- ))
82
 
83
- end_time = time.time()
84
- runtime = end_time - start_time
85
 
86
- final_history, final_system_message = result[-1]
87
- print('Local Runtime: ', runtime)
88
- print('Local Final conversation history:', final_history)
89
- print('Local Final system message:', final_system_message)
90
 
91
- if __name__ == '__main__':
92
- test_api()
93
- test_local()
94
- """
 
1
+ # name: Testing output
2
 
3
  # on:
4
  # push:
 
8
  # branches:
9
  # - main
10
 
11
+ # jobs:
12
+ # build:
13
+ # runs-on: ubuntu-latest
14
 
15
+ # steps:
16
+ # - uses: actions/checkout@v3 # Update to v3
17
+ # - name: Set up Python
18
+ # uses: actions/setup-python@v3 # Update to v3
19
+ # with:
20
+ # python-version: '3.x'
21
+ # - name: Install dependencies
22
+ # run: |
23
+ # python -m pip install --upgrade pip
24
+ # pip install gradio huggingface_hub torch transformers accelerate
25
+ # - name: Run tests
26
+ # run: |
27
+ # python -c """
28
+ # import time
29
+ # from app import respond, base_message
30
 
31
+ # def test_api():
32
+ # message = 'What is the meaning of life?'
33
+ # history = []
34
+ # system_message_val = base_message
35
+ # temperature = 0.7
36
+ # practicality = 0.8
37
+ # max_tokens = 256
38
+ # use_local_model = False # Set to False to use the API-based model
39
 
40
+ # start_time = time.time()
41
 
42
+ # result_generator = respond(
43
+ # message=message,
44
+ # history=history,
45
+ # system_message_val=system_message_val,
46
+ # temperature=temperature,
47
+ # practicality=practicality,
48
+ # max_tokens=max_tokens,
49
+ # use_local_model=use_local_model
50
+ # )
51
 
52
+ # for result in result_generator:
53
+ # final_history, final_system_message = result
54
 
55
+ # end_time = time.time()
56
+ # runtime = end_time - start_time
57
 
58
+ # print('API Runtime: ', runtime)
59
+ # print('API Final conversation history:', final_history)
60
+ # print('API Final system message:', final_system_message)
61
 
62
+ # def test_local():
63
+ # message = 'What is the meaning of life?'
64
+ # history = []
65
+ # system_message_val = base_message
66
+ # temperature = 0.7
67
+ # practicality = 0.8
68
+ # max_tokens = 256
69
+ # use_local_model = True
70
 
71
+ # start_time = time.time()
72
 
73
+ # result = list(respond(
74
+ # message=message,
75
+ # history=history,
76
+ # system_message_val=system_message_val,
77
+ # temperature=temperature,
78
+ # practicality=practicality,
79
+ # max_tokens=max_tokens,
80
+ # use_local_model=use_local_model
81
+ # ))
82
 
83
+ # end_time = time.time()
84
+ # runtime = end_time - start_time
85
 
86
+ # final_history, final_system_message = result[-1]
87
+ # print('Local Runtime: ', runtime)
88
+ # print('Local Final conversation history:', final_history)
89
+ # print('Local Final system message:', final_system_message)
90
 
91
+ # if __name__ == '__main__':
92
+ # test_api()
93
+ # test_local()
94
+ # """