You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "sultanalieva-s (via GitHub)" <gi...@apache.org> on 2023/08/07 11:23:33 UTC
[GitHub] [beam] sultanalieva-s opened a new pull request, #27876: Code completion plugin: Add Starcoder Completions
sultanalieva-s opened a new pull request, #27876:
URL: https://github.com/apache/beam/pull/27876
Added api call to Hugging Face's StarCoder Model to perform completions.
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/get-started-contributing/#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Code completion plugin: Add Starcoder Completions [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27876:
URL: https://github.com/apache/beam/pull/27876#issuecomment-1775107195
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@beam.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] chamikaramj commented on pull request #27876: Code completion plugin: Add Starcoder Completions
Posted by "chamikaramj (via GitHub)" <gi...@apache.org>.
chamikaramj commented on PR #27876:
URL: https://github.com/apache/beam/pull/27876#issuecomment-1690444591
BTW I suggest following :)
Update the Beam dev list regarding this plugin via an email that includes a short proposal if you haven't already done so (a doc with one to few pages should be fine).
If there's no disagreement in the dev list, remove the "This project is not officially supported by Apache Beam" tag.
Make sure that this feature is adequately tested via unit/integration testing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] pabloem commented on a diff in pull request #27876: Code completion plugin: Add Starcoder Completions
Posted by "pabloem (via GitHub)" <gi...@apache.org>.
pabloem commented on code in PR #27876:
URL: https://github.com/apache/beam/pull/27876#discussion_r1287291907
##########
plugins/beam-code-completion-plugin/src/main/java/BeamCompletionContributor.java:
##########
@@ -89,8 +98,36 @@ public boolean accepts(@NotNull PsiMethodCallExpression psiMethodCallExpression,
@Override
public void fillCompletionVariants(@NotNull final CompletionParameters parameters, @NotNull CompletionResultSet result) {
if (AFTER_METHOD_CALL_PATTERN.accepts(parameters.getPosition())){
- for (String transform: beamJavaSDKTransforms) {
- result.addElement(LookupElementBuilder.create(transform).appendTailText(" org.apache.beam.sdk.transforms", true));
+ try {
+ int offset = parameters.getOffset();
+ String full_code = parameters.getOriginalFile().getText();
+ String code_to_complete = full_code.substring(0, offset);
+
+ Parameters model_parameters = new Parameters(0.1F, false);
+ RequestBody req_body_obj = new RequestBody(code_to_complete, model_parameters);
+
+ String request_body_json = new Gson().toJson(req_body_obj);
+ String model_url = "https://api-inference.huggingface.co/models/bigcode/starcoder";
Review Comment:
lets make this configurable with a default value of `https://api-inference.huggingface.co/models/bigcode/starcoder-base`
##########
plugins/beam-code-completion-plugin/src/main/java/Parameters.java:
##########
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+public class Parameters {
+ private float temperature;
+ private boolean return_full_text;
Review Comment:
I recommend you create this as an AutoValue class. WDYT?
If you would prefer to avoid AutoValue, then at least make these two variables `final`.
##########
plugins/beam-code-completion-plugin/src/main/java/RequestBody.java:
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+public class RequestBody {
+ private String inputs;
+ private Parameters parameters;
Review Comment:
I recommend you create this as an AutoValue class. WDYT?
If you would prefer to avoid AutoValue, then at least make these two variables `final`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Code completion plugin: Add Starcoder Completions [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #27876: Code completion plugin: Add Starcoder Completions
URL: https://github.com/apache/beam/pull/27876
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] github-actions[bot] commented on pull request #27876: Code completion plugin: Add Starcoder Completions
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27876:
URL: https://github.com/apache/beam/pull/27876#issuecomment-1667734724
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment `assign set of reviewers`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] github-actions[bot] commented on pull request #27876: Code completion plugin: Add Starcoder Completions
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27876:
URL: https://github.com/apache/beam/pull/27876#issuecomment-1688068789
Reminder, please take a look at this pr: @chamikaramj
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Code completion plugin: Add Starcoder Completions [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27876:
URL: https://github.com/apache/beam/pull/27876#issuecomment-1787143894
This pull request has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] sultanalieva-s commented on pull request #27876: Code completion plugin: Add Starcoder Completions
Posted by "sultanalieva-s (via GitHub)" <gi...@apache.org>.
sultanalieva-s commented on PR #27876:
URL: https://github.com/apache/beam/pull/27876#issuecomment-1667678897
Could you please take a look ? @pabloem
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] sultanalieva-s commented on pull request #27876: Code completion plugin: Add Starcoder Completions
Posted by "sultanalieva-s (via GitHub)" <gi...@apache.org>.
sultanalieva-s commented on PR #27876:
URL: https://github.com/apache/beam/pull/27876#issuecomment-1678792095
@pabloem, addressed your comments, thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] chamikaramj commented on pull request #27876: Code completion plugin: Add Starcoder Completions
Posted by "chamikaramj (via GitHub)" <gi...@apache.org>.
chamikaramj commented on PR #27876:
URL: https://github.com/apache/beam/pull/27876#issuecomment-1688479986
I'm not familiar regarding the "beam-code-completion-plugin" project but was there any proposal or a dev list thread that describes the problem and the solution ?
I'm also confused by the "This project is not officially supported by Apache Beam." tag in the page below given that this is in the main Beam repo.
https://github.com/apache/beam/tree/master/plugins/beam-code-completion-plugin
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] github-actions[bot] commented on pull request #27876: Code completion plugin: Add Starcoder Completions
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27876:
URL: https://github.com/apache/beam/pull/27876#issuecomment-1667871344
Assigning reviewers. If you would like to opt out of this review, comment `assign to next reviewer`:
R: @chamikaramj added as fallback since no labels match configuration
Available commands:
- `stop reviewer notifications` - opt out of the automated review tooling
- `remind me after tests pass` - tag the comment author after tests pass
- `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
The PR bot will only process comments in the main thread (not review comments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org