Skip to content

Commit

Permalink
Testing Azure Function
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul committed May 16, 2024
1 parent 14c7320 commit 8f734ee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import pandas as pd
import tensorflow as tf
from flask import Flask, request
from flask import Flask, request, Response
from pythainlp import word_tokenize

flask_app = Flask(__name__)
Expand Down Expand Up @@ -40,8 +40,11 @@ def tokenize_text(x):
return ' '.join(list(filter(lambda y: y.replace(' ', ''), word_tokenize(filter_thai(x)))))


@flask_app.function_name(name="paulxieptest")
@flask_app.post("/predict", auth_level=func.AuthLevel.ANONYMOUS)
@flask_app.get("/basic")
def basic_test():
return [1], 200

@flask_app.post("/predict")
def run_ai():
if request.headers['aikey'] == os.environ['AIKEY']:
if request.is_json:
Expand Down

0 comments on commit 8f734ee

Please sign in to comment.