qq1023 commited on
Commit
c78677e
1 Parent(s): d5e8f61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -114,10 +114,9 @@ def query(category, text):
114
  1. Construct a prompt
115
  2. Generate a response
116
  """
117
- try:
118
- category = Category[category]
119
- except KeyError:
120
- return [{"error": f"Invalid category: {category}"}]
121
  chain = categories.category_modules[category].chain
122
  formatted_prompt = chain.prompt.format_prompt(
123
  text=text,
 
114
  1. Construct a prompt
115
  2. Generate a response
116
  """
117
+
118
+ category = Category[category]
119
+
 
120
  chain = categories.category_modules[category].chain
121
  formatted_prompt = chain.prompt.format_prompt(
122
  text=text,