DIVY118 commited on
Commit
bc93908
·
verified ·
1 Parent(s): 3b0ffc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -31
app.py CHANGED
@@ -12,37 +12,7 @@ from time import time as t
12
  app = Flask(__name__)
13
 
14
 
15
- # Tracking API usage
16
- generation_config = {
17
- "temperature": 0.7,
18
- "top_p": 1,
19
- "top_k": 1,
20
- "max_output_tokens": 350,
21
- }
22
-
23
- safety_settings = [
24
- {
25
- "category": "HARM_CATEGORY_HARASSMENT",
26
- "threshold": "BLOCK_MEDIUM_AND_ABOVE"
27
- },
28
- {
29
- "category": "HARM_CATEGORY_HATE_SPEECH",
30
- "threshold": "BLOCK_MEDIUM_AND_ABOVE"
31
- },
32
- {
33
- "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
34
- "threshold": "BLOCK_MEDIUM_AND_ABOVE"
35
- },
36
- {
37
- "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
38
- "threshold": "BLOCK_MEDIUM_AND_ABOVE"
39
- },
40
- ]
41
-
42
- model = genai.GenerativeModel(
43
- model_name="gemini-pro",
44
- generation_config=generation_config,
45
- safety_settings=safety_settings)
46
 
47
 
48
  @app.route('/mistral7b', methods=['POST'])
@@ -129,6 +99,37 @@ def Genration():
129
  key = data.get('key', '')
130
 
131
  C=t()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  genai.configure(api_key=key)
133
  response = model.generate_content(messages)
134
 
 
12
  app = Flask(__name__)
13
 
14
 
15
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
 
18
  @app.route('/mistral7b', methods=['POST'])
 
99
  key = data.get('key', '')
100
 
101
  C=t()
102
+ # Tracking API usage
103
+ generation_config = {
104
+ "temperature": 0.7,
105
+ "top_p": 1,
106
+ "top_k": 1,
107
+ "max_output_tokens": 350,
108
+ }
109
+
110
+ safety_settings = [
111
+ {
112
+ "category": "HARM_CATEGORY_HARASSMENT",
113
+ "threshold": "BLOCK_MEDIUM_AND_ABOVE"
114
+ },
115
+ {
116
+ "category": "HARM_CATEGORY_HATE_SPEECH",
117
+ "threshold": "BLOCK_MEDIUM_AND_ABOVE"
118
+ },
119
+ {
120
+ "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
121
+ "threshold": "BLOCK_MEDIUM_AND_ABOVE"
122
+ },
123
+ {
124
+ "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
125
+ "threshold": "BLOCK_MEDIUM_AND_ABOVE"
126
+ },
127
+ ]
128
+
129
+ model = genai.GenerativeModel(
130
+ model_name="gemini-pro",
131
+ generation_config=generation_config,
132
+ safety_settings=safety_settings)
133
  genai.configure(api_key=key)
134
  response = model.generate_content(messages)
135