MCPcopy Create free account
hub / github.com/chinawithfrank/ChatBotCourse / do_GET

Method do_GET

tf_classify_demo/classify.py:50–61  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48
49class MyServer(BaseHTTPRequestHandler):
50 def do_GET(self):
51 self.send_response(200)
52 self.send_header("Content-type", "application/json")
53 self.end_headers()
54 arg_dict = parse.urlparse(self.path)
55 if len(arg_dict.query) > 0 and 'q' in parse.parse_qs(arg_dict.query):
56 q = parse.parse_qs(arg_dict.query)['q'][0]
57 x_s = samples.generate_xs(q)
58 local_group_id = sess.run(tf.argmax(y, 1), feed_dict={x:x_s})[0]
59 group_id = samples.maps.real_group_id_map[str(local_group_id)]
60 print("q=", q, "group_id=", group_id)
61 self.wfile.write(bytes(str(group_id), "utf-8"))
62
63def main(is_predict):
64 if is_predict:

Callers

nothing calls this directly

Calls 1

generate_xsMethod · 0.80

Tested by

no test coverage detected